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

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -