Friday, February 3, 2012

Get Row Count for every table in database.

This script will gives row number for every table in database.

USE AdventureWorks
GO
SELECT OBJECT_NAME(OBJECT_ID) TableName, st.row_countFROM sys.dm_db_partition_stats stWHERE index_id < 2ORDER BY st.row_count DESCGO

No comments:

Post a Comment