Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Store mutiple identity values from insert
Message
From
16/07/2002 13:09:21
 
 
To
16/07/2002 09:38:09
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00674695
Message ID:
00679214
Views:
21
>Would the inserted table in the trigger have the indentity values in it? I never tried that. If it does, it would be a simple matter to store them to another table.

Interesting question. I've never checked.

It appears that the Inserted table does contain the assigned IDENTITY values. You can see for yourself with the follow script:
USE pubs
CREATE TABLE testtable (c int identity(1,1), name nvarchar(40))

CREATE TRIGGER testtable_insert ON testtable FOR INSERT
AS
SELECT * FROM inserted

INSERT INTO testtable (name)
SELECT au_lname FROM authors

INSERT INTO testtable (name)
SELECT au_lname FROM authors
WHERE au_lname LIKE 'b%'
-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform