我想将数据从一台服务器发送到另一台服务器,我希望提高我的性能,并想知道OpenQuery是否是一条很好的路径?
我试着做这样的事情;
INSERT INTO OPENQUERY (SERVERNAME, '(SELECT Num1, Num2, Num3 FROM [DBName].[dbo].TableName)')
(Num1, Num2, Num3)
SELECT Num1, Num2, Num3
FROM #Temp
然而,这会返回错误
The provider indicates that conflicts occurred with other properties or requirements.
我不明白这一点,因为查询运行正常并且在没有OpenQuery的情况下产生所需的结果......
你们中有人可以告诉我吗?
答案 0 :(得分:1)
试试这个:
INSERT INTO tablename
SELECT * FROM OPENROWSET
('SQLOLEDB',
'Trusted_Connection=yes;Server=SERVERNAME','SELECT Num1, Num2, Num3 FROM [DBName].[dbo].TableName)')