Thread: lock a table
View Single Post
  #8 (permalink)  
Old 10-07-08, 16:57
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,015
That's a significant stored procedure. Seems like you're doing a lot of processing in there. Is all of it required in one stored procedure?

Here's an example showing how the START TRANSACTION and COMMIT WORK can be used:
Code:
CREATE PROCEDURE TransTest()
AS
BEGIN
START TRANSACTION; 
UPDATE Billing B 

SET Amount_Owed = Amount_Owed - Amount_Paid 
WHERE Student_ID IN 
(SELECT DISTINCT E.Student_ID 
FROM Enrolls E, Billing B 
WHERE E.Student_ID = B.Student_ID); 
COMMIT WORK; 
end;
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote