摘要:查看工作数据库中共有多少表,多少记录的语句,可以用sp_MSforeachtable系统存储过程方便的实现,如下1 CREATE TABLE #temp (TableName VARCHAR (255), RowCnt INT)2 EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?'3 SELECT TableName, RowCnt FROM #temp ORDER BY RowCnt desc4 DROP TABLE #temp当然也可以用游标或循环遍
阅读全文
posted @ 2012-05-28 19:33