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.
| Author |
Topic |
|
ranjeetsingh_6
Posting Yak Master
125 Posts |
Posted - 2006-07-14 : 03:43:55
|
| Hi I declare a variable and set this value. again i want to insert this value in another table How I do this task ? I am using this query declare @name varchar(50) set @name='select name from sal where salary=1000' insert into record(name) values(@name)Ranjeet Kumar Singh |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-07-14 : 03:51:09
|
Change it to this...declare @name varchar(50)select @name = name from sal where salary=1000insert into record(name) values(@name) Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-07-14 : 05:37:49
|
you can also insert direct into table without going through variableinsert into record(name)select namefrom salwhere salary = 1000 KH |
 |
|
|
ranjeetsingh_6
Posting Yak Master
125 Posts |
Posted - 2006-07-14 : 06:41:24
|
| HiThanks To you problem have solvedRanjeet Kumar Singh |
 |
|
|
|
|
|