Commands We Can Use To Rename A Database In SQL Server 2008
How we can rename a database in SQL Server 2008 ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Oct 30, 2012, 4:17 AM
http://blog.sqlauthority.com/2007/07/13/sql-server-2005-use-alter-database-modify-name-instead-of-sp_renamedb-to-rename/
Sandeep Singh ShekhawatPosted Oct 29, 2012, 12:35 AM
ALTER DATABASE MyOldDb MODIFY NAME = MyNewDb
Here
MyOldDb : It is already exist database which name will be change.
MyNewDb : It is new name of database which we will give to database
OR
By store proceudre
you cann use system store procedure which is sp_renamedb Like
EXEC sp_renamedb 'MyOldDb', 'MyNewDb'
Here
MyOldDb : It is already exist database which name will be change.
MyNewDb : It is new name of database which we will give to database
Vishnujeet KumarPosted Oct 29, 2012, 12:24 AM