Monday 29 March 2010

GUI Bad! SQL Good!

SQL Server (2005) hasn't been very kind to me lately. Among it's many faults, the one that cheesed me today was that in the course of testing a problem, I wanted to take one of the databases offline, do some stuff, and bring it online again. Well don't do this through the management studio GUI. When we did this, the offline process just hung there. According to Pinal Dave, the recommended way of doing things is like this:

ALTER DATABASE [mydb] SET OFFLINE WITH ROLLBACK AFTER 30 SECONDS


This way, if there's some wedged transactions (as were the source of our problems in the first place), this should rollback anything that doesn't finish in 30 seconds.

- Arch

Popular Posts