Created
October 27, 2016 14:57
-
-
Save gazlu/2c0e55d2e9a4ac640208a2a5c3311cb7 to your computer and use it in GitHub Desktop.
Insert multiple records and get the identity value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE #A (ID int Identity(1,1), fn varchar(10)) | |
DECLARE @output TABLE (id int) | |
Insert into #A (fn) | |
OUTPUT inserted.ID INTO @output | |
values ('1'), ('2'), ('3') | |
select * from @output | |
DROP TABLE #A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment