Is there a way in SMSS to detect whether a table has any records? I need to get a list of tables that have records. perhaps there is a sql statement that will do the trick?<
Hope, It helps you-
SELECT name AS [TableList] FROM SYS.DM_DB_PARTITION_STATS s INNER JOIN sys.tables t ON t.[object_id] = s.[object_id] WHERE row_count = 0
This code shows that list of tables, which does not contain any data or row.
Thanks!!!