Wednesday, July 31, 2013

Error: the database could not be exclusively locked to perform the operation in sql server 2008 ?

Thats because someone else is accessing the database.. Put the database into single user mode the rename it.



USE [master];
GO
ALTER DATABASE foo SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
EXEC sp_renamedb N'foo', N'bar';



vt




Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker


No comments:

Post a Comment