首先设置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