存储过程 错误 大神们 帮小弟看下 create proc proc_manager
@tablename varchar,
@strWhere varchar,
@count int output
as
begin
declare @strSql nvarchar(1000)
set @strSql='select @count=count(1) from '+@tablename+' where '+@strWhere
end
exec sp_executesql @strSql,N'@count int output',@count output
declare @sum int
exec proc_manager 'ask','id>0',@sum output
print @sum
alter proc proc_manager
@tablename varchar,
@strWhere varchar,
@count int output
as
begin
declare @strSql nvarchar(1000)
set @strSql='select '+CONVERT(VARCHAR(10),@count)+'=count(1) from '+@tablename+' where '+@strWhere
end
exec sp_executesql @strSql,N'@count int output',@count output
declare @sum int
exec proc_manager 'ask','id>0',@sum output
print @sum