sql server - Copy One Column value of one table into column of another table -


i have product table , location table in sql server 2008. want insert productid of product table productid column of location table using sql script. , insert other columns value of location table static,but productid column value want insert product table using sql script.

please me?

without knowing table structure, , assuming field1 varchar , field2 int can this:

insert locationtable (productid, field1, field2) select productid, 'field1', 10 producttable .... 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -