ITeye博客

MS SQL SERVER2005跨服务器查询

cary · 2008-12-09 17:16 · DB · Markdown

1:打开'Ad Hoc Distributed Queries'

exec sp_configure 'show advanced options',1 reconfigure exec sp_configure 'Ad Hoc Distributed Queries',1 reconfigure

关闭只要将1设置为0

2:建立链路服务器 EXEC sp_addlinkedserver
'120Host', //昵称 '',
'SQLOLEDB',
NULL,
NULL,
'DRIVER={SQL Server};SERVER=IP,1433;UID=sa;PWD=;' go exec sp_addlinkedsrvlogin '120Host','false','sa','sa',''
GO

3:既可以建立查询 select * from openquery(,'select * from 库名.dbo.表名')

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。