Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

SET TRANSACTION ISOLATION LEVEL

Avatar of jackbenson
jackbensonFlag for United Kingdom of Great Britain and Northern Ireland asked on
Server HardwareMicrosoft SQL Server 2005
3 Comments1 Solution684 ViewsLast Modified:
Hi,

i have created a database for my companies stock system in SQL Server 2005.

when there are stock movements (i.e. we despatch or receive stock) we need to adjust the stock record for the product being despatched / recieved.

i need to make sure that this stored procedure is not run more than once at the same time.

would using the following be sensible?


SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
      
BEGIN TRANSACTION;

COMMIT TRANSACTION;


Further to this.. do you HAVE to have all the code in a stored procedure within the BEGIN TRANSACTION.... COMMIT TRANSACTION? or just the section of SQL that related to updating the stock record.

thanks

jack