动态sql语句输出参数
declare @sql nvarchar(2000) declare @cou int declare @id varchar(20) set @id='1' set @sql='select @count=count(*) from emp where id=@id' exec sp_executesql @sql, N'@count int out,@id varchar(20)', @cou out ,@id print @cou
@cou接收 @count传出的值