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?

William
  • 6,332
  • 8
  • 38
  • 57

1 Answers1

1

try this:

INSERT INTO tablename 
SELECT * FROM OPENROWSET
    ('SQLOLEDB', 
     'Trusted_Connection=yes;Server=SERVERNAME','SELECT Num1, Num2, Num3 FROM [DBName].[dbo].TableName)')
AnandPhadke
  • 13,160
  • 5
  • 26
  • 33