Thursday, February 28, 2013

MSSQL Restore locked database

Below is a short snippet that will allow you to restore your database by putting it in single user mode.

After restoring (if without errors) it will be in multi user mode again. If it is not you can still run the
alter database DATABASE_NAME set multi_user
command to put it back in original mode.

USE master;
 
ALTER DATABASE [DATABASE_NAME] SET single_user WITH ROLLBACK immediate;
 
restore DATABASE [DATABASE_NAME] FROM disk = 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\YOUR_AWESOME_BACKUP.bak';

Monday, February 4, 2013

New Baby

I know, this is not technical stuff, but I'm really happy and excited about it.



Soon (between this week and the next one) I will become a Dad!!!