跨服务器访问数据库

来源:互联网 发布:江苏减招事件知乎 编辑:程序博客网 时间:2024/05/20 03:38


--插入语句

insert into WxOrderInfo( AppId, Bank_Type, Cash_Fee, Fee_Type, Is_Subscribe, Mch_id, Nonce_Str, OpenId, Out_Trade_No, Result_Code, Return_Code, [Sign], Time_End, Total_Fee, Trade_Type, Transaction_Id, States)

SELECT  AppId, Bank_Type, Cash_Fee, Fee_Type, Is_Subscribe, Mch_id, Nonce_Str, OpenId, Out_Trade_No, Result_Code, Return_Code, [Sign], Time_End, Total_Fee, Trade_Type, Transaction_Id, States
FROM OPENDATASOURCE( 
'SQLOLEDB', 
'Data Source=hjxu;User ID=sa;Password=global' 
).webticket.dbo.WxOrderInfo


--启用Ad Hoc Distributed Queries: 
exec sp_configure 'show advanced options',1 
reconfigure 
exec sp_configure 'Ad Hoc Distributed Queries',1 
reconfigure 
   


--关闭Ad Hoc Distributed Queries: 
exec sp_configure 'Ad Hoc Distributed Queries',0 
reconfigure 
exec sp_configure 'show advanced options',0 
reconfigure



0 0
原创粉丝点击