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
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
本文标题:sp_executesql 的使用
本文链接:https://www.haomeiwen.com/subject/ofyboctx.html
网友评论