|
Posted by pb648174 on 03/09/06 00:22
In a multi-user environment, I would like to get a list of Ids
generated, similar to:
declare @LastId int
select @LastId = Max(Id) From TableMania
INSERT INTO TableMania (ColumnA, ColumnB)
SELECT ColumnA, ColumnB From OtherTable Where ColumnC > 15
--get entries just added
SELECT * FROM TableMania WHERE Id > @LastId
The above works fine, except I'm assuming it will not work in a
multi-user environment. Is there any way to get the set of Ids that
were just added in the previous statement (similar to @@IDENTITY)
without doing all of this in a serializable transaction or making a
temp table of every single Id before the insert statement?
Navigation:
[Reply to this message]
|