Exec sp_droplinkedsrvlogin dbvip, null
Exec sp_dropserver dbvip
Exec sp_addmediaserver
@ Server = 'dbvip ', -- the alias of the accessed Server
@ Srvproduct = '',
@ Provider = 'sqloledb ',
@ Datasrc = 'server2' -- the server to be accessed
Exec sp_add1_srvlogin
'Dbvip ', -- the alias of the accessed Server
'False ',
Null,
'Sa ', -- account
'Thankyoubob' -- Password
Select * From dbvip. Pubs. DBO. Orders
////////// //////////////////
Exec sp_droplinkedsrvlogin demo, null
Exec sp_dropserver demo
Go
Exec sp_addmediaserver
@ Server = 'Demo ',
@ Srvproduct = 'oracle ',
@ Provider = 'msdaora ',
@ Datasrc = 'servicename'
Exec sp_add1_srvlogin
'Demo ',
'False ',
Null,
'Userid ',
'Password'
Go
Select * From openquery (demo, 'select * From tbdemo ')
Update openquery (demo, 'select ID from tbdemo where id = 100 ')
Set Name = 'hello ';
Insert openquery (demo, 'select ID from tbdemo ')
Values ('hello ');
Delete openquery (demo, 'select ID from tbdemo where name = 'Hello ''');