Scope_Identity() and transaction in a stored procedure

Hello,

Do i need to place  a SELECT SCOPE_IDENTITY() inside a transaction (with an SP) to assure integrity of data, or can i place it freely ?

Thanks for this tips !

Jiib
jiib75Asked:
Who is Participating?
 
jdlambert1Commented:
It doesn't have to be in an explicit transaction, but the value should be captured immediately after a record is inserted. You can store it in a variable if you want to use it later.
0
 
jiib75Author Commented:
thanks.

Jiib
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.