Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Use the right tool to get identity values back after an insert

Language: Layout:
View schema
Execution time: 0,05 sec, rows selected: 2, rows affected: 7, absolute service time: 0,28 sec, absolute service time: 0,28 sec  
latest |  history
   demo Scope_Identity() IDENT_CURRENT('TblIdentityDemo') @@IDentity Id Col
1 After a succesful insert 2 2 -10 2 2
   demo Scope_Identity() IDENT_CURRENT('TblIdentityDemo') @@IDentity Id Col
1 After a failed insert 2 3 -10 2 2
   demo id Col
1 output -20 1
2 output -30 2
3 output -40 3
4 output -50 4

    
                
λ
.NET NoSQL database for rapid development