首先設定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