Hi, I have here another question... I was asking me how works commit in SQL 2000? For example, you have an application, this applicantion is doing an insert, update or delete through a SP... not only a simple query.... and then it hangs up and force to close the application ... the last query commit itself or it does a rollback? or it corrupts the data?
How can I handel this?
Thanks a lot for your answeres... Regards,
Transactions are either explicit or implicit. If there is not a begin tran or begin transaction with a corresponding commit or rollback then the transaction is implicit and SQL will commit the transaction for you under the covers.
An excellent article covering how transactions work can be found here
answered Apr 28 '12 at 03:04 AM
As Tim said, there is always a transaction. All transactions are committed in conformance with ACID principles. SQL will log all changes as it goes to make it possible to roll back a transaction at any point up until it is finally committed.
As to your direct question about the last query in your stored procedure, it depends on when the application hangs up. If the application hangs up after the commit is finished, then it is committed and SQL Server will not make a further change. If the connection is broken before the transaction fully commits, it will roll back, using the log it made.
answered Apr 30 '12 at 08:09 PM