0

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?

1 Answer 1

1

try this:

INSERT INTO tablename 
SELECT * FROM OPENROWSET
    ('SQLOLEDB', 
     'Trusted_Connection=yes;Server=SERVERNAME','SELECT Num1, Num2, Num3 FROM [DBName].[dbo].TableName)')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.