In this post we will discuss how to rename an existing database in sql server 2008. Also you can check out my previous posts on:
To rename a database use the following sql query.
ALTER DATABASE TestDB
Modify Name = TestDBNew ;
Here TestDB is the old database name and TestDBNew is the new database name.
While executing this query if you are getting the below error:
"The database could not be exclusively locked to perform the operation", then check this solution
Hope it will be helpful to you.