Is it possible in sql server using stored procedure to return the identity column value in a table against which some values are inserted? For example using stored procedure if we insert data in a table:
Table TBL
- UserID integer, identity, auto-incremented
- Name varchar
- UserName varchar
- Password varchar
So if I run the store procedure inserting some values like:
Insert into TBL (Name, UserName, Password)
Values ('example', 'example', '$2a$12$00WFrz3dOfLaIgpTYRJ9CeuB6VicjLGhLset8WtFrzvtpRekcP1lq')
How can I return the value of UserID
at which this insertion will take place. I need The value of UserID for some other operations, can anybody solve this?