您的位置:首页 > 数据库

跨服务器访问数据库

2015-06-04 16:07 281 查看
--插入语句

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: