can SQL insert using select return multiple identities? [duplicate]
This question already has an answer here: How to insert multiple records and get the identity value? 7 answers I am insertnig into a table using a selection INSERT california_authors (au_id, au_lname, au_fname) SELECT au_id, au_lname, au_fname FROM authors WHERE State = 'CA' say i have an identity column in california_authors . Can i get all the ids inserted by the above particular insertion just like i can get @@IDENTITY for last single insertion ? I can't use select command for california_authors as there may exists previously inserted records with filter State = 'CA' You can use the output