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
 SQL Server Development (2000)
 what happens when power is off

Author  Topic 

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2004-06-14 : 21:44:38
Hi friends
I've some piece of code in stored proc that takes couple of minutes to complete.ofcourse all code between transaction.i mean something like
begin transa
--big code
commit trans

i'm wondering what happens if power is gone during the execution on the server??




Cheers

nr
SQLTeam MVY

12543 Posts

Posted - 2004-06-14 : 21:53:13
When the server comes back up part of recovery is to roll back incomplete transactions.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2004-06-14 : 21:55:44
thanks for the post nr.
sql server does this rollback automatically??

Cheers
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-06-14 : 21:57:17
yes

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2004-06-14 : 21:58:21
Thank u very much Derrick :-)

Cheers
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2004-06-15 : 05:49:15
Incidentally you should probably look at breaking up your code if you have two minute long transactions..

-------
Moo. :)
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2004-06-15 : 08:26:40
Can you say UPS (Uninterruptible Power Supply).
No way I would have a server without one.
Even Semi critical desktops should have one.


Jim
Users <> Logic
Go to Top of Page
   

- Advertisement -