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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Insert into using select

Author  Topic 

Sarakumar
Posting Yak Master

108 Posts

Posted - 2009-05-11 : 06:20:05
Hai,
i have a table in which there are only two columns id ,item
Id will be input parameter and item should come from select statement.
how can i do that..
can i write something like the following statement.
insert into @TblTemp(id,Item)
@id, select distinct Item
from cfgtblitem

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-11 : 06:23:36
[code]
insert into @TblTemp (id, Item)
select distinct @id, Item
from cfgtblitem
[/code]


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

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-05-11 : 06:24:06
insert into @TblTemp(id,Item)
select distinct @id,Item
from cfgtblitem


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-05-11 : 06:25:39


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -