MSSQL : Rename DB that is having Can’t Exclusively Locked

Do you want to¬†rename DB that is having can’t exclusively locked error message.

 

Try this.

ALTER DATABASE dbname
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE dbnameMODIFY NAME = [dbname.DevData]
ALTER DATABASE [dbname.DevData]
SET MULTI_USER WITH ROLLBACK IMMEDIATE

 

God Bless!

Author: Thomie Jose San Agustin

He is a Microsoft Certified Professional whom develop different website using ASP .NET MVC and PHP. He can also create systems out of C#. A Magna Cum Laude of Adamson University whom started a Freelance company named i-CT Combinatorics Technology with his friend Calbin Montalban. He accepts both Website and System development and even can help now his colleagues in generating their logic and research.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.