sqlserver常用查询

-----查询所有表和行数

SELECT a.name, b.rows

FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id

WHERE (a.type = 'u') AND (b.indid IN (0, 1))

ORDER BY b.rows DESC

 

---单表更新更新统计信息  100万行大概25秒

UPDATE STATISTICS dbo.表名 WITH FULLSCAN

 

posted @ 2021-11-25 17:16  鸾舞春秋  阅读(42)  评论(0编辑  收藏  举报