way 1:
exec sp_addlinkedserver 'srv_lnk','','SQLOLEDB','cnshdnfeng1'
exec sp_addlinkedsrvlogin 'srv_lnk','false',null,'sa','sa'
go
exec sp_addlinkedsrvlogin 'srv_lnk','false',null,'sa','sa'
go
select * from srv_lnk.SunSystemsData.dbo.ANL_DIR
exec sp_dropserver 'srv_lnk','droplogins'
way 2:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
GO
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
select * from openrowset('SQLOLEDB','cnshdnfeng1';'sa';'sa', SunSystemsData.dbo.ANL_DIR)
No comments:
Post a Comment