大家好,问一个问题。
tbTableInfo表:
[tableID]
001
002
003
而数据库中有表tb001、tb002……
怎能查到:
[tableID] [count(每个表的总记录数)]
001
002
003
tbTableInfo表:
[tableID]
001
002
003
而数据库中有表tb001、tb002……
怎能查到:
[tableID] [count(每个表的总记录数)]
001
002
003
right(name,3),
rowcn
from sysindexes
where name in ('tb001',...)
set @s=''
select @s=@s+'select name=''' + name + ''',cnt=count(*) from ' + name + ' union ' from (select * from sysobjects where name like 'tb[0-9][0-9][0-9]' and xtype='u')x
select @s=left(@s,len(@s)-5)
exec(@s)