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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Urgent help in nesting queries

Author  Topic 

subashinikumar
Starting Member

10 Posts

Posted - 2009-07-15 : 02:20:24
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, @d
from first



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

subashinikumar
Starting Member

10 Posts

Posted - 2009-07-15 : 02:32:29
Thanks a lot .Its working ..

Subashini Kumar
Go to Top of Page
   

- Advertisement -