E
eddywx
Unregistered / Unconfirmed
GUEST, unregistred user!
create procedure aa
@tablename varchar(20) --传入表名参数
as
declare @sqlstring varchar(200) --动态sql字符串
Set @sqlstring = 'select count(*) from '+@tablename
exec(@sqlstring)
....紧接着我想用这个count(*)的值,
我该如何取的呢?
(Set @sqlstring = 'select @某变量=count(*) from '+@tablename
行不通!)
@tablename varchar(20) --传入表名参数
as
declare @sqlstring varchar(200) --动态sql字符串
Set @sqlstring = 'select count(*) from '+@tablename
exec(@sqlstring)
....紧接着我想用这个count(*)的值,
我该如何取的呢?
(Set @sqlstring = 'select @某变量=count(*) from '+@tablename
行不通!)