-2

Kindly help me writing below query in openquery.Thanks in advance

 INSERT INTO  Tablename

    SELECT * FROM tablename1 WHERE insertionorderid IN (

    SELECT orderid FROM temp_table2)
venu
  • 53
  • 1
  • 1
  • 6

1 Answers1

0

If you are trying to insert into SQL Server the syntax would be

INSERT INTO dbo.[YOURTABLE] SELECT * FROM [MATCHING_TABLE] WHERE CLAUSE

The caveat here is that the two tables must have identical schemas or you will have to explicitly define the columns. Also this will not work properly for tables with identity columns

bumble_bee_tuna
  • 3,533
  • 7
  • 43
  • 83