sql server - Inserting some data from one table into another table -


i going populate intersection table value table (view), have 1 value static each insert.

my query looks this:

insert dbo.intersectiontable (col1, col2) select *col3*, col4 dbo.viewtable *col3* null 

now, col3 field need switch out static value (eg. 11), how can both insert table , specify 1 static value?

my guess be

insert dbo.intersectiontable (col1, col2) values (11, (select col4 dbo.viewtable col3 null)) 

but me doesn't quite right.

you can try this...

insert dbo.intersectiontable (col1, col2) select 11, col4 dbo.viewtable col3 null 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -