sql server - Insert into table does not work with select left join -
i trying insert new records openrowset query existing table not exist in table. here's code:
insert src_table rep.id ,rep.column1 openrowset (blabla) rep left join src_table tab on rep.id = tab.id tab.id null
i error:
incorrect syntax near 'rep'.
however when run query follows:
select rep.id ,rep.column1 openrowset (blabla) rep left join src_table tab on rep.id = tab.id tab.id null
works expected giving me rows don't exist in src_table. doing wrong?
you had it:
insert table (id, column) select rep.id ,rep.column1 openrowset (blabla) rep left join src_table tab on rep.id = tab.id tab.id null
Comments
Post a Comment