登上服务器,查出大于1G的表:select TABLE_NAME,DATA_LENGTH, concat(round(((DATA_LENGTH+index_LENGTH)/1024/1024/1024), 2), 'G') as data from information_schema.TABLES where TABLE_SCHEMA='dbname' and DATA_LENGTH > 1000000000;+-------------------------+-------------+-------+| TABLE_NAME ...【阅读全文】
Add an identity to your table variable, and do an easy loop from 1 to the @@ROWCOUNT of the INSERT-SELECT.Try this:点击(此处)折叠或打开DECLARE @RowsToProcess intDECLARE @CurrentRow intDECLARE @SelectCol1 int...【阅读全文】
要想知道每个数据库的大小的话,步骤如下:1、进入information_schema 数据库(存放了其他的数据库的信息)use information_schema; 2、查询所有数据的大小:select concat(round(sum(data_length/1024/1024),2),’MB’) as data from tables; 3、查看指定数据库的大小:比如...【阅读全文】