日期:2014-05-18 浏览次数:20692 次
--====1建立链接服务器,确保你本机可以访问到虚拟空间
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
--创建链接服务器
exec sp_addlinkedserver 'ITSV ', ' ', 'SQLOLEDB ', '远程服务器名或ip地址 '
exec sp_addlinkedsrvlogin 'ITSV ', 'false ',null, '用户名 ', '密码 '
--====2在链接服务器的库上操作!
set identity_insert ITSV.[xsd].dbo.[xsd_webContentZ] on
insert into ITSV.xsd.dbo.xsd_webContentZ(webConZ_id,..) --插入的字段都写出来,注意一定要写自增列
select *
from xsd_webContentZ --本地表
set identity_insert ITSV.[xsd].dbo.[xsd_webContentZ] off
--====3删除链接服务器
exec sp_dropserver 'ITSV ', 'droplogins '
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure