您的位置:首页 > 博客中心 > 数据库 >

存储过程与SQL的结合使用

时间:2022-03-10 17:46

--1调用存储过程
exec 存储过程名 参数

openrowset方法使用:

select * from openrowset(‘sqlncli‘, ‘server=192.168.247.64;uid=sa;pwd=123;‘, ‘exec dbo.process ‘‘参数值‘‘‘) as tmp;

-------------------------------------------------------------------------------------------------------------------------

a、启用Ad Hoc Distributed Queries:

exec sp_configure ‘show advanced options‘,1
reconfigure
exec sp_configure ‘Ad Hoc Distributed Queries‘,1
reconfigure

b、关闭Ad Hoc Distributed Queries:

exec sp_configure ‘Ad Hoc Distributed Queries‘,0
reconfigure
exec sp_configure ‘show advanced options‘,0
reconfigure

存储过程与SQL的结合使用,布布扣,bubuko.com

热门排行

今日推荐

热门手游