时间:2021-07-01 10:21:17 帮助过:4人阅读
如果表有外键,不适合采用此方法。
查询所有表的记录数 SQL 语句:
来自:https://www.cnblogs.com/dahuzizyd/archive/2004/07/19/25565.html
SELECT ‘Owner‘=CONVERT(CHAR(10),t.TABLE_SCHEMA), ‘Table Name‘=CONVERT(CHAR(25),t.TABLE_NAME), ‘Record Count‘=MAX(i.ROWS) FROM SYSINDEXES i, INFORMATION_SCHEMA.TABLES t WHERE t.TABLE_NAME = OBJECT_NAME(i.ID) AND t.TABLE_TYPE = ‘BASE TABLE‘ GROUP BY t.TABLE_SCHEMA, t.TABLE_NAME ORDER BY MAX(i.ROWS) DESC
[转][SQL]转移数据到历史表步骤
标签:span truncate where record har color format col form