Skip to content
Advertisement

Tag: identity

Getting new IDs after insert

I’m inserting a bunch of new rows into a table which is defined as follows: using the following insert: when I’ve finished, I’d like to know the IDs of all the newly inserted rows. SCOPE_IDENTITY() only returns the ID last row inserted. How can I get all the new IDs? One method that springs to mind would be to grab

Advertisement