How to get IDENTITY values on Multi-Rows insertion in SQL Server

In general problem scenario, we need to capture the IDENTITY value after insertion operation in a table. This is achieved by using SCOPE_IDENTITY(), @@IDENTITY and IDENT_CURRENT() function. The above functions doesn’t works in case of multi-rows insertion. SQL Server 2005 introduced the OUTPUT clause as part of INSERT statement which we can use to capture IDENTITY  values on multi-rows insertion. Problem Scenario Read more about How to get IDENTITY values on Multi-Rows insertion in SQL Server[…]