Table Row counts Sql Server 2005

You can get the same in SSMS, by selecting ‘Reports’ option in the Database context sensitive menu

SELECT
	distinct Table_Name = object_name(object_id),
	T.TABLE_SCHEMA,
	Total_Rows =  st.row_count
FROM sys.dm_db_partition_stats st INNER JOIN information_schema.tables T
on object_name(object_id) = T.TABLE_NAME
where object_name(object_id) not like 'sys%' and object_name(object_id) not like 'queue%'
ORDER BY object_name(object_id)
Wednesday, January 7th, 2009 SQL Server 2005

No comments yet.

Leave a comment

You must be logged in to post a comment.