I have a table with an Identity Column
Create Table T1( Col1 INT Identity Primary Key ,COL2nvarchar(100) ...........)
When the insert statement failed for any reason the Col1 still increasing .....
1- Can i change this behaviour ? I means is there a documented way to prevent the Auto increment IF the insert operation failed ?
2- When i use Scope_IDENTITY() function it Returns the SUCCSSED inserted Identity .. what about if INSERT failed how can i get the autoIncremental number for the failed insert?