--同时加载多个参数 declare @aa nvarchar(40) declare @min_lvl tinyint execute sp_executesql N'select job_desc,min_lvl from jobs where job_id=6',N'@aa nvarchar(40) output,@min_lvl tinyint output' ,@aa output,@min_lvl output print @aa print @
--同时加载多个参数
declare @aa nvarchar(40)
declare @min_lvl tinyint
execute sp_executesql N'select job_desc,min_lvl from jobs where job_id=6',N'@aa nvarchar(40) output,@min_lvl tinyint output' ,@aa output,@min_lvl output
print @aa
print @min_lvl
---------------------------------------------------------------------
--只能加载一个参数
declare @aa nvarchar(40)
execute sp_executesql N'select @aa=job_desc from jobs where job_id=6',N'@aa nvarchar(40) output',@aa output select @aa