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 2005 Forums
 Transact-SQL (2005)
 will Stored procedure rollback if it fails?

Author  Topic 

chih
Posting Yak Master

154 Posts

Posted - 2008-03-05 : 20:20:30
Hi everyone,

I don't specify the following statements in SP.
begin transaction
commit transaction
rollback

In sp, there are a lot of insert and update. If i execute SP and stop it in half way. will it rollback all update and insert statement? also, will it rollback if it fails?

cheers

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2008-03-05 : 20:41:22
THat depends largely on what the procedure is doing, and where in the procedure it is.

No..it will not rollback already completed inserts and deletes prior to killing it or stopping the procedure's execution.





Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page
   

- Advertisement -