May
13
2015
mssql远程操作服务器
use master
go
/*添加服务器*/
EXEC sp_addlinkedserver
@server = ‘192.168.1.222’, /*此名字可以随便取*/
@srvproduct = ‘SQL’,
@provider = ‘SQLOLEDB’,
@datasrc = ‘192.168.1.222’ /*说明:另外一台服务器的IP*/
go
/*登陆服务器*/
EXEC sp_addlinkedsrvlogin
@rmtsrvname =’xxxx’, /*需要跟前面连接的同一个名字*/
@useself = ‘false’,
@locallogin = ‘sa’,
@rmtuser = ‘sa’,
@rmtpassword = ‘xxx’ /*登陆密码*/
select * from healthone.healthone.dbo.BBX1_DEL
exec sp_dropserver ‘192.168.1.222’, ‘droplogins’
最活跃的读者