Solved

Scope_Identity() and transaction in a stored procedure

Posted on 2004-10-12
2
799 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now