Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Store mutiple identity values from insert
Message
From
02/07/2002 16:01:41
Martin Van Krieken
Capgemini Nederland Bv
Utrecht, Netherlands
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Store mutiple identity values from insert
Miscellaneous
Thread ID:
00674695
Message ID:
00674695
Views:
72
Hello,

I'm building a stored procedure which inserts multiple records in a table from a select statement like this:

Insert into TargetTable
(Field1, Field2, Field3)
Select Fld1, Fld2, Fld3 From SourceTable

This works fine, but the targettable has an identity field and I want to store the identity values of the added records in another table. I know I kan do this with Fetch Into, but for performance reasons I would like to build one statement to insert values in the targettable and store the resulting identity values in the other table.
Is this possible?

TIA,

Martin
Next
Reply
Map
View

Click here to load this message in the networking platform