说明:两个服务器:192.168.0.22 A192.168.0.3 B数据库备份在A上数据库在B上 在A上写: exec sp_addlinkedserver 'ITSV2', ' ', 'SQLOLEDB', '服务器地址' exec sp_addlinkedsrvlogin 'ITSV2', 'false',null, '用户名', '密码' --SQL语句 insert into BookDB.
说明:
两个服务器:
192.168.0.22 A
192.168.0.3 B
数据库备份在A上
数据库在B上
在A上写:
exec sp_addlinkedserver 'ITSV2', ' ', 'SQLOLEDB', '服务器地址'
exec sp_addlinkedsrvlogin 'ITSV2', 'false',null, '用户名', '密码'
--SQL语句
insert into BookDB.dbo.T_ID(id)select FenJian_ID from ITSV2.BookDB.dbo.T_FenJian where YingFu_SongHuoFei = 50
--关闭服务器链接
exec sp_dropserver 'ITSV2', 'droplogins '
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn