系统存储过程sp_executesql的简单使用

–系统存储过程
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

发布了43 篇原创文章 · 获赞 35 · 访问量 1608

猜你喜欢

转载自blog.csdn.net/qq_45244974/article/details/103574919