跨服务器访问数据库
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
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
相关文章推荐
- .net防止Sql注入之SqlParameter参数详解
- 字符集、编码以及Oracle的那些事
- 字符集、编码以及Oracle的那些事
- 字符集、编码以及Oracle的那些事
- 字符集、编码以及Oracle的那些事
- 字符集、编码以及Oracle的那些事
- MongoDB基本使用
- 几点建议,让Redis在你的系统中发挥更大作用
- oracle表锁问题
- 安装sqlserver 遇到服务操作系统与安装文件语言环境不一致问题
- ORACLE HANDBOOK系列
- ORACLE HANDBOOK系列
- ORACLE HANDBOOK系列
- ORACLE HANDBOOK系列
- ORACLE HANDBOOK系列
- 整理php操作memcache缓存基础方法
- plsqL复习
- 常用的SQL语句大全
- Data Base sql server 备份数据库
- 简单的sql查询优化