–系统存储过程
declare @i int = 7
declare @j int = 5
exec sp_executesql
N’select * from Student where ID<@i and ID >@j’,
N’@i int,@j int’,
@i,@j
–输出参数
declare @c int
exec sp_executesql
N’select @c = count(*) from Student’,
N’@c int out’,
@c out
–系统存储过程
declare @i int = 7
declare @j int = 5
exec sp_executesql
N’select * from Student where ID<@i and ID >@j’,
N’@i int,@j int’,
@i,@j
–输出参数
declare @c int
exec sp_executesql
N’select @c = count(*) from Student’,
N’@c int out’,
@c out