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

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -