Life Interesting Bit
Tuesday, August 17, 2010
SQLSERVER中统计所有表的记录数
Create TABLE #temp (TableName VARCHAR (255), RowCnt INT)
EXEC sp_MSforeachtable 'Insert INTO #temp Select ''?'', COUNT(*) FROM ?'
Select TableName, RowCnt FROM #temp ORDER BY TableName
Drop TABLE #temp
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment