Solved

Scope_Identity() and transaction in a stored procedure

Posted on 2004-10-12
2
802 Views
Last Modified: 2008-03-06
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
0
Comment
Question by:jiib75
2 Comments
 
LVL 15

Accepted Solution

by:
jdlambert1 earned 200 total points
ID: 12293025
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
 

Author Comment

by:jiib75
ID: 12302221
thanks.

Jiib
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question