Repro has three different queries of the following forminsert into #toutput inserted.a into #inserted_intovalues ('a'),('b');select scope_identity()If only #t has an IDENTITY column defined then scope_identity returns the ID from #t.If both tables have an IDENTITY column defined then scope_identity returns the ID from #inserted_into If only #inserted_into has an IDENTITY column defined then scope_identity returns NULL.(Originally found http://stackoverflow.com/q/12698388/73226)
Product Language
Version
Category
Operating System
Operating System Language
Steps to Reproduce
Actual Results
Expected Results
Platform
Virtualization