What's up!

Pyaarey Allah!

Friday, August 2, 2013

Rename a busy database in SQL Server

use master
ALTER DATABASE YourDBName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
 
use YourDBName;
go

checkpoint;
go

use master;
go

alter database YourDBName modify name = YourDBNameNewName;
go
 
ALTER DATABASE YourDBName SET MULTI_USER

0 comments: (+add yours?)

Post a Comment