回答:
你可以让你的解决方案更加灵活一些,通过从sysobjects表中抓取表名:
declare @strsql varchar(256)
create table #emptytables
(tablename varchar(128), table_rowcount int)select
@strsql=’select distinct o.name as TableName,
.rowcnt as Table_RowCount
from sysobjects o
inner join sysindexes x
on o.id = x.id
where x.rowcnt = 0 and
o.type = ‘’U”’insert #emptytables (TableName,
Table_rowcount) exec (@strsql)
select * from #emptytables
drop table #emptytables
文章来源于领测软件测试网 https://www.ltesting.net/