mysql>use information_schema
mysql>select data_length,index_length
->from tables where
->table_schema='DBNAME'
->and table_name = 'TABLENAME'
mysql>select concat(round(sum(data_length/1024/1024),2),'MB') as data_length_MB, ->concat(round(sum(index_length/1024/1024),2),'MB') as index_length_MB
->from tables where
->table_schema='DBNAME'
->and table_name = 'TABLENAME'
if (select object_ID('tempdb..#BaseInfoFK')) >0 drop table #BaseInfoFKselect a.* into #BaseInfoFK from (select * from table)a#BaseInfoFK是临时表的名一定要加#
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)