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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -