SQL2005 导入其它服务器数据

首先设置SQL2005服务组件

EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
GO

再通过SQL语句来查询导入数据

insert into sa_tree select * from OPENROWSET('SQLOLEDB', 'SERVER=172.27.27.126;uid=sa;pwd=jibojibo;Database=snsDB','select * from sa_tree') as a

你可能感兴趣的:(sql2005)