Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LOCKING ISSUES 1

Status
Not open for further replies.

svagelis

Programmer
May 2, 2001
121
GR
I have one table that contains 3 columns (ID,Index,Desc)
I use this table to collect Index and Desc in order to
make a primary key to another table.After i collect index and desc , i increase the value of Index by one.
What i want is to ensure that while i m reading Index , inserting record to another table and increase index , no other user will read index and got the same value as i got.
Is there a way to prevent others from reading index while i m doing this job?
Thanks!!
 
Sounds like you want to wrap this up into a transaction
Have a look at the SQL Server Books online to find out more about the TSQL command BEGIN TRANSACTION
 
just reading thru today's posts and found this. cool stuff terry. thanks.
-michelle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top