Posted onSeptember 19, 2011 by Josephine database could not be exclusively locked to perform the operation error on SQL Server ALTER DATABASE oldDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE oldDBname MODIFY NAME =newDBname ALTER DATABASE newDBname SET MULTI_USER