문제

I want to send data across from one server to another, I wish to improve my performance and wondered if OpenQuery is a good route to go down?

I tried to do something like this;

INSERT INTO OPENQUERY (SERVERNAME, '(SELECT Num1, Num2, Num3 FROM [DBName].[dbo].TableName)')
(Num1, Num2, Num3)
SELECT Num1, Num2, Num3
 FROM #Temp

However this returns the error

The provider indicates that conflicts occurred with other properties or requirements.

I don't understand this as the query does run fine and produce the required results without OpenQuery...

Could any of you advise me on this please?

도움이 되었습니까?

해결책

try this:

INSERT INTO tablename 
SELECT * FROM OPENROWSET
    ('SQLOLEDB', 
     'Trusted_Connection=yes;Server=SERVERNAME','SELECT Num1, Num2, Num3 FROM [DBName].[dbo].TableName)')
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top