Msg 5030, Level 16, State 2, Line 17 The database could not be exclusively locked to perform the operation.
ALTER DATABASE
as sp_renamedb
may be phased out in future releases.
EXEC sp_renamedb 'dev_db', 'test_db';
ALTER DATABASE dev_db MODIFY NAME = test_db;