Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alter table command ignored, Why?
Message
From
08/04/2002 10:41:37
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Alter table command ignored, Why?
Miscellaneous
Thread ID:
00642194
Message ID:
00642194
Views:
69
When this command runs as a stored proc it does not execute the alter table command before the insert command (although it works in Query Analyzer) as I still get an error about trying to insert a value into the primary key (docket_price_id (Indentity Column)). This proc is simply trying to copy a series of records from one docket_id to another within the same table.
Apparently this question was asked of Microsoft and they said that stored procs run differently then Query Analyzer, ya, thanks a lot, but with no
other help). I still need to make this work somehow...


CREATE PROCEDURE docket_copy_children
@docket_from_id INT,
@docket_to_id INT
AS

select * into #d1 from docket_prices where docket_id=@docket_from_id
update #d1 set docket_id=@docket_to_id
alter table #d1 drop column docket_price_id
insert into docket_prices select * from #d1

go
Next
Reply
Map
View

Click here to load this message in the networking platform