Paste this into a new question or an answer at dba.stackexchange.com:
<!-- --> > CREATE TABLE Connections > ( > [ID] [int] IDENTITY(1,1) NOT NULL, > [User] [nvarchar](20) NOT NULL, > [UserID] [int] NULL, > [True] [bit] NOT NULL, > [Comment] [nvarchar](max) NOT NULL, > [Created] [datetime] NOT NULL, > [Flag] [bit] NULL, > [Destination] [varchar](255) NULL > ) > > <pre> > ✓ > </pre> <!-- --> > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Talon Richmond',973,'1','Nullam vitae diam. Proin dolor. Nulla semper tellus','2020-03-15','0','Bosnia and Herzegovina'),('Marsden Marquez',886,'0','dictum cursus. Nunc mauris elit, dictum eu,','2020-02-09','1','Martinique'),('Jermaine Farmer',177,'1','Vestibulum ante ipsum primis in faucibus orci luctus et','2019-06-21','1','Zambia'),('Jackson Moss',36,'1','Morbi neque tellus, imperdiet non,','2021-03-18','0','Greece'),('Owen Caldwell',829,'0','eu sem. Pellentesque ut ipsum ac mi eleifend','2020-11-12','1','Falkland Islands'),('Daniel Lynn',381,'0','molestie orci tincidunt adipiscing. Mauris molestie pharetra nibh. Aliquam ornare,','2019-08-14','1','Mongolia'),('Walter Gill',262,'0','Pellentesque tincidunt tempus risus. Donec','2021-03-17','0','Greenland'),('Jordan Keith',84,'1','orci, in consequat enim diam vel','2020-10-06','1','Korea, North'),('Porter Gardner',740,'0','penatibus et magnis dis parturient montes, nascetur','2020-08-24','0','Solomon Islands'),('Wesley Tyson',584,'0','consectetuer euismod est arcu ac orci. Ut semper pretium','2019-05-21','1','New Caledonia'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('William Foreman',213,'0','vestibulum nec, euismod in, dolor.','2019-05-11','0','Thailand'),('Eric Weeks',866,'0','convallis convallis dolor. Quisque tincidunt pede ac urna.','2020-08-22','0','Zambia'),('Levi Travis',775,'0','pellentesque eget, dictum placerat, augue. Sed','2020-07-31','1','Saint Lucia'),('Knox Bass',779,'0','diam vel arcu. Curabitur ut odio vel est tempor','2020-10-08','1','Isle of Man'),('Alec Diaz',748,'0','eu tellus. Phasellus elit pede, malesuada vel, venenatis vel,','2020-02-28','0','Belgium'),('Hedley Snow',931,'0','magna tellus faucibus leo, in lobortis tellus justo sit amet','2019-08-04','1','Thailand'),('Alfonso Trujillo',609,'1','mus. Donec dignissim magna a tortor. Nunc commodo','2020-08-14','0','Virgin Islands, United States'),('Oscar Hendrix',198,'1','diam. Sed diam lorem, auctor quis, tristique','2020-09-29','0','Senegal'),('Igor Douglas',147,'1','nunc. In at pede. Cras vulputate velit','2019-09-04','1','Kyrgyzstan'),('Kennan Whitley',316,'0','ac turpis egestas. Aliquam fringilla cursus','2020-04-24','0','Syria'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Felix Clay',499,'0','ut, nulla. Cras eu tellus eu augue','2020-12-10','1','Virgin Islands, United States'),('Fulton Lindsey',801,'0','Suspendisse sagittis. Nullam vitae diam. Proin dolor. Nulla','2019-10-13','0','Tajikistan'),('William Vaughan',89,'1','et ultrices posuere cubilia Curae; Donec','2020-10-12','1','Guernsey'),('Dante Clements',150,'0','dapibus quam quis diam. Pellentesque habitant morbi tristique','2021-01-29','1','Oman'),('Jelani Mcfadden',929,'1','mi felis, adipiscing fringilla, porttitor vulputate,','2019-06-11','1','Mali'),('Zahir Gutierrez',391,'1','in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus','2020-08-03','1','American Samoa'),('Amos Hodge',716,'1','urna, nec luctus felis purus ac tellus.','2020-11-19','1','Lesotho'),('Kirk Christensen',822,'0','primis in faucibus orci luctus et ultrices posuere cubilia Curae;','2020-01-27','0','Vanuatu'),('William Cochran',669,'1','ornare placerat, orci lacus vestibulum','2021-03-30','0','Sint Maarten'),('Dante Fox',609,'0','pretium aliquet, metus urna convallis erat, eget','2021-04-04','0','Ghana'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Colorado Walter',490,'0','Proin eget odio. Aliquam vulputate ullamcorper magna. Sed eu eros.','2020-05-16','0','Antarctica'),('Leonard Mack',134,'1','at sem molestie sodales. Mauris blandit enim','2020-01-21','0','Spain'),('Ivor Boyd',629,'0','sodales. Mauris blandit enim consequat purus.','2020-09-16','0','Papua New Guinea'),('Vance Crosby',994,'0','In mi pede, nonummy ut, molestie in, tempus eu,','2019-08-14','1','United Arab Emirates'),('Rudyard Odom',410,'1','est. Nunc ullamcorper, velit in aliquet lobortis,','2021-05-04','1','Armenia'),('Vladimir Gaines',359,'0','diam. Sed diam lorem, auctor','2021-01-03','1','Qatar'),('Lyle Baldwin',698,'0','Suspendisse sagittis. Nullam vitae diam. Proin','2020-04-07','0','United States'),('Andrew Weaver',538,'1','elit. Etiam laoreet, libero et tristique pellentesque, tellus sem mollis','2019-07-13','1','Antarctica'),('Allen Campbell',975,'1','luctus et ultrices posuere cubilia Curae; Donec','2020-05-16','0','Portugal'),('Drake Dawson',615,'0','facilisis, magna tellus faucibus leo, in lobortis tellus','2019-09-01','1','Solomon Islands'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Maxwell Sargent',71,'0','faucibus. Morbi vehicula. Pellentesque tincidunt tempus risus. Donec egestas. Duis','2020-12-04','1','Oman'),('Steven Gilbert',22,'0','parturient montes, nascetur ridiculus mus. Proin','2020-07-09','1','Estonia'),('Steven Foley',561,'0','neque. Nullam ut nisi a odio semper cursus.','2019-08-15','0','Bangladesh'),('Yardley Ochoa',951,'0','vulputate, lacus. Cras interdum. Nunc','2020-07-08','0','Luxembourg'),('Ahmed Warner',960,'0','pharetra sed, hendrerit a, arcu. Sed et libero. Proin mi.','2021-03-12','1','San Marino'),('Victor Leonard',287,'1','adipiscing fringilla, porttitor vulputate, posuere vulputate, lacus.','2019-10-24','0','Iraq'),('Dillon Lawrence',333,'0','neque tellus, imperdiet non, vestibulum nec, euismod','2021-04-15','1','Kyrgyzstan'),('Dennis Kerr',877,'1','dictum eu, eleifend nec, malesuada','2021-02-04','1','Palau'),('Callum Faulkner',607,'0','Cras interdum. Nunc sollicitudin commodo ipsum.','2019-07-11','1','Venezuela'),('Ashton Howard',223,'0','turpis egestas. Aliquam fringilla cursus purus.','2019-09-27','1','Japan'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Zeus Hammond',365,'0','eget magna. Suspendisse tristique neque venenatis lacus. Etiam bibendum fermentum','2021-05-07','1','Hungary'),('Channing Reid',914,'1','non, vestibulum nec, euismod in, dolor. Fusce','2020-03-23','1','Egypt'),('Cedric Harrington',449,'1','volutpat. Nulla dignissim. Maecenas ornare','2020-10-14','1','Faroe Islands'),('Chaim Nash',752,'1','congue a, aliquet vel, vulputate eu, odio. Phasellus at','2020-05-14','0','Cook Islands'),('Basil Miller',3,'0','enim, sit amet ornare lectus justo eu','2020-09-05','0','Saint Kitts and Nevis'),('Reed Perez',55,'1','libero et tristique pellentesque, tellus sem mollis','2020-06-03','1','Tonga'),('Gavin Nash',635,'0','dolor elit, pellentesque a, facilisis non, bibendum sed,','2021-04-02','1','Dominican Republic'),('Grant Lara',615,'0','elementum, dui quis accumsan convallis, ante lectus','2019-12-12','1','Uganda'),('Clark Coleman',252,'1','Aliquam gravida mauris ut mi. Duis risus odio, auctor vitae,','2021-04-03','1','Bonaire, Sint Eustatius and Saba'),('Anthony Mullen',348,'1','primis in faucibus orci luctus et ultrices posuere cubilia Curae;','2019-08-11','1','Nigeria'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Emerson Stevenson',674,'0','Sed et libero. Proin mi.','2020-07-31','1','Cameroon'),('Tad Chan',379,'1','velit. Aliquam nisl. Nulla eu neque pellentesque','2019-08-20','0','South Africa'),('Wallace Morse',919,'1','orci, adipiscing non, luctus sit amet, faucibus ut, nulla.','2020-10-21','0','Chad'),('Valentine Lloyd',964,'0','ante dictum mi, ac mattis velit justo nec ante.','2019-09-26','1','Canada'),('Forrest Lawrence',781,'0','purus mauris a nunc. In','2021-04-23','1','French Guiana'),('Colorado Duffy',805,'1','posuere cubilia Curae; Donec tincidunt. Donec vitae erat vel','2019-08-29','0','Niger'),('Steel Weiss',455,'1','blandit mattis. Cras eget nisi','2019-12-09','0','Saint Kitts and Nevis'),('Declan Brock',825,'1','cursus a, enim. Suspendisse aliquet, sem ut','2020-02-03','1','Seychelles'),('Jordan Grimes',129,'0','elementum sem, vitae aliquam eros turpis','2020-06-30','0','Sweden'),('Phelan Mueller',320,'0','augue scelerisque mollis. Phasellus libero mauris,','2019-10-25','0','Kazakhstan'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Channing Burnett',642,'1','ullamcorper. Duis cursus, diam at pretium aliquet, metus urna convallis','2021-03-08','1','Micronesia'),('Xanthus Herman',959,'1','ligula elit, pretium et, rutrum','2019-10-01','0','Korea, North'),('Amir Vega',767,'1','dictum placerat, augue. Sed molestie.','2020-09-05','0','Niger'),('Herrod Rodgers',59,'0','Nullam enim. Sed nulla ante, iaculis','2021-04-01','1','Austria'),('Brian Medina',606,'1','lorem ut aliquam iaculis, lacus pede sagittis','2021-04-18','0','Kyrgyzstan'),('Reece Roman',742,'1','elit, pellentesque a, facilisis non, bibendum sed, est. Nunc laoreet','2019-10-06','1','Solomon Islands'),('Nissim Zamora',412,'0','euismod mauris eu elit. Nulla facilisi. Sed neque.','2020-08-23','0','Finland'),('Holmes Oliver',378,'0','bibendum sed, est. Nunc laoreet','2019-12-11','0','Slovakia'),('Silas Miller',203,'0','lacus. Mauris non dui nec','2020-12-22','0','United States'),('Abdul Irwin',63,'0','nisl. Maecenas malesuada fringilla est.','2019-07-21','0','Netherlands'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Tucker Hunt',329,'1','sapien imperdiet ornare. In faucibus. Morbi vehicula. Pellentesque','2020-04-08','1','French Southern Territories'),('Jerry Bentley',397,'1','molestie tellus. Aenean egestas hendrerit neque. In ornare sagittis felis.','2021-01-14','1','United Arab Emirates'),('Nathaniel Spence',421,'0','imperdiet dictum magna. Ut tincidunt orci quis lectus.','2020-02-27','0','Nigeria'),('Lucius Wong',922,'1','ac ipsum. Phasellus vitae mauris sit','2020-04-09','0','Western Sahara'),('Paki Gutierrez',77,'0','sodales nisi magna sed dui. Fusce aliquam, enim nec tempus','2021-04-19','0','Brunei'),('Noble Ferguson',403,'1','habitant morbi tristique senectus et','2020-03-04','0','Philippines'),('Ira Carson',445,'0','varius et, euismod et, commodo at,','2021-02-13','0','Colombia'),('Stone George',383,'1','enim nisl elementum purus, accumsan interdum libero dui','2020-08-13','0','Palestine, State of'),('Todd Hammond',781,'0','dolor. Fusce feugiat. Lorem ipsum dolor','2021-04-24','1','Timor-Leste'),('Chaim Steele',211,'1','aliquet diam. Sed diam lorem, auctor quis, tristique ac,','2020-12-20','1','Australia'); > INSERT INTO Connections([User],[UserID],[True],[Comment],[Created],[Flag],[Destination]) VALUES('Reed Mullen',123,'1','aliquet magna a neque. Nullam','2021-03-23','0','Trinidad and Tobago'),('Holmes Cantu',782,'1','luctus ut, pellentesque eget, dictum placerat, augue. Sed molestie.','2019-12-14','1','Somalia'),('Dexter Witt',267,'0','molestie arcu. Sed eu nibh vulputate mauris sagittis placerat. Cras','2021-01-19','1','Seychelles'),('Keith Ross',872,'1','commodo tincidunt nibh. Phasellus nulla. Integer vulputate, risus a ultricies','2020-12-31','0','Eritrea'),('Yuli Tran',278,'1','mauris, rhoncus id, mollis nec, cursus a, enim. Suspendisse aliquet,','2020-11-15','0','Macao'),('Zachary Yang',476,'0','mollis. Integer tincidunt aliquam arcu. Aliquam ultrices iaculis odio. Nam','2020-09-30','0','Russian Federation'),('Victor Walls',51,'0','lectus. Cum sociis natoque penatibus et magnis dis parturient montes,','2020-03-25','0','Papua New Guinea'),('Jameson Klein',911,'0','eget nisi dictum augue malesuada','2019-12-29','1','Sao Tome and Principe'),('Fuller Gordon',630,'0','semper rutrum. Fusce dolor quam, elementum at, egestas a,','2019-10-31','1','Venezuela'),('Michael Hopkins',699,'1','molestie orci tincidunt adipiscing. Mauris molestie pharetra nibh.','2020-02-27','0','Reunion'); > > <pre> 100 rows affected > </pre> <!-- --> > SELECT DATEPART(year,created) AS [Year], > DATEPART(month,created) AS [Month], > COUNT(*) AS Rows, > SUM(DATALENGTH([User]) + DATALENGTH([UserID]) + DATALENGTH([True]) + DATALENGTH([Comment]) + DATALENGTH([Created]) + DATALENGTH([Flag]) + DATALENGTH([Destination])) AS TotalRowSize, > AVG(DATALENGTH([User]) + DATALENGTH([UserID]) + DATALENGTH([True]) + DATALENGTH([Comment]) + DATALENGTH([Created]) + DATALENGTH([Flag]) + DATALENGTH([Destination])) AS AvgRowSize, > MIN(DATALENGTH([User]) + DATALENGTH([UserID]) + DATALENGTH([True]) + DATALENGTH([Comment]) + DATALENGTH([Created]) + DATALENGTH([Flag]) + DATALENGTH([Destination])) AS MinRowSize, > MAX(DATALENGTH([User]) + DATALENGTH([UserID]) + DATALENGTH([True]) + DATALENGTH([Comment]) + DATALENGTH([Created]) + DATALENGTH([Flag]) + DATALENGTH([Destination])) AS MaxRowSize > FROM Connections > GROUP BY DATEPART(year,created),DATEPART(month,created) > > <pre> > Year | Month | Rows | TotalRowSize | AvgRowSize | MinRowSize | MaxRowSize > ---: | ----: | ---: | -----------: | ---------: | ---------: | ---------: > 2020 | 1 | 2 | 314 | 157 | 131 | 183 > 2021 | 1 | 4 | 661 | 165 | 105 | 208 > 2020 | 2 | 5 | 779 | 155 | 134 | 183 > 2021 | 2 | 2 | 219 | 109 | 109 | 110 > 2020 | 3 | 4 | 618 | 154 | 125 | 192 > 2021 | 3 | 6 | 846 | 141 | 112 | 198 > 2020 | 4 | 4 | 593 | 148 | 122 | 195 > 2021 | 4 | 9 | 1302 | 144 | 105 | 192 > 2019 | 5 | 2 | 283 | 141 | 120 | 163 > 2020 | 5 | 3 | 486 | 162 | 144 | 186 > 2021 | 5 | 2 | 350 | 175 | 143 | 207 > 2019 | 6 | 2 | 312 | 156 | 152 | 160 > 2020 | 6 | 2 | 267 | 133 | 126 | 141 > 2019 | 7 | 3 | 466 | 155 | 125 | 194 > 2020 | 7 | 4 | 512 | 128 | 104 | 145 > 2019 | 8 | 7 | 1142 | 163 | 134 | 208 > 2020 | 8 | 6 | 996 | 166 | 147 | 194 > 2019 | 9 | 4 | 572 | 143 | 124 | 165 > 2020 | 9 | 5 | 721 | 144 | 111 | 204 > 2019 | 10 | 6 | 970 | 161 | 116 | 187 > 2020 | 10 | 5 | 688 | 137 | 114 | 160 > 2020 | 11 | 3 | 436 | 145 | 119 | 173 > 2019 | 12 | 5 | 673 | 134 | 110 | 179 > 2020 | 12 | 5 | 798 | 159 | 101 | 212 > </pre> *db<>fiddle [here](https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=624c1d3930dec0a78ea969c5b20396e1)*
back to fiddle