Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi,I have 2 tables .In one table i have 3 columns "a,b,c".In the other table i have 4 columns "a,b,c,d".I want to use a procedure such that i have to insert into second table , the values of columns "a,b,c" from first table and for the fourth column of the second table i have to use the parameter passed into the procedure.How is it possible with a single query.Subashini Kumar
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-07-15 : 02:28:02
insert into second (a, b, c, d)select a, b, c, @dfrom first