Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tsql:count_rows_in_every_table [2017/07/21 21:47]
127.0.0.1 external edit
tsql:count_rows_in_every_table [2018/07/04 22:23] (current)
admin
Line 8: Line 8:
 SELECT @sql += ' SELECT @sql += '
   UNION ALL SELECT '''​ + s.name + '​.'​ + o.name   UNION ALL SELECT '''​ + s.name + '​.'​ + o.name
-  + ''',​ COUNT(*) FROM [' + s.name + '​].['​ + o.name + '​]'​+  + ''',​ COUNT(*) FROM [' + s.name + '​].['​ + o.name + '​] ​WITH (NOLOCK)'
 FROM sys.objects o FROM sys.objects o
   INNER JOIN sys.schemas s ON s.schema_id = o.schema_id   INNER JOIN sys.schemas s ON s.schema_id = o.schema_id