Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 About ‘Cancel Excuting Query‘

Author  Topic 

heovang1211
Starting Member

5 Posts

Posted - 2009-11-17 : 22:15:07

Now, I have 1 stored procedure 'UpdateCustomer':
.....
begin tran updatetable
-- step 1 : insert tblUser
insert tblUser values('Tommy', 1)
….
process something
select * from tblUser
….
continue processing something ....
-- step 5 : update tblCustomer
update tblCustomer set Customer_name = “Cus A” where ….
commit tran updatetable
....
When this stored is processed, if it executes to step 4 and I click button ‘Cancel Executing Query’, I find that, at the step 1, tblUser table was inserted success, and step 5, tblCustomer table doesn’t update yet.
But, what I need is everything have to roll backs (commands from step 1 to step 4 will not affect to DB), it meant the data won’t insert to table tblUser. I also use the Transaction, but it’s not work.

Please help me to find out another way to solve this issue.
Thank you very much.
   

- Advertisement -