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 2000 Forums
 Transact-SQL (2000)
 Inserting set of data into a table - Newbie

Author  Topic 

sunnyjassal
Starting Member

28 Posts

Posted - 2004-04-04 : 08:51:26
Hello -

In T-sql stored procedure..How can I insert a set of data into a table..
basically this is what i am trying to do:
with the assumption that sometable has only one column -

insert into sometable values(select id from othertable where value = @somevalue)

it keeps on giving me an error... if the above approach is not correct then what would be another approach to do this

Thanks for your help in advance

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-04-04 : 09:27:53
http://www.sqlteam.com/item.asp?ItemID=277

- Jeff
Go to Top of Page

vganesh76
Yak Posting Veteran

64 Posts

Posted - 2004-04-05 : 12:23:34
Hi,
You cant give select statement when u are using Values keyword
Try this.


insert into sometable
select id from othertable where value = @somevalue



regards,
Ganesh V.
Net AssetManagement India Pvt Ltd.

Enjoy working
Go to Top of Page
   

- Advertisement -