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)
 synatax help

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2005-08-26 : 03:38:24
Here's my started proc that is not correct

CREATE PROCEDURE movetemporder
@orderid int,
@temporderid int

AS

insert into plansperorder(orderid,adapterid,powersupply,planid)
values(@orderid,select adapterid,powersupply,planid from tempplansperorder where orderid=@temporderid)

GO

what I am trying to do is take all the records from tempplansperorder where orderid=temporderid(passed in) and add them all to plansperorder with the real orderid(also passed in to the proc)

how can i do this correctly?

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2005-08-26 : 04:04:39
[code]
insert into plansperorder(orderid,adapterid,powersupply,planid)
select @orderid,adapterid,powersupply,planid
from tempplansperorder
where orderid=@temporderid
[/code]
Go to Top of Page
   

- Advertisement -