Commands We Can Use To Rename A Database In SQL Server 2008
How we can rename a database in SQL Server 2008 ?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vishnujeet KumarRank #1,019 · 1.9K reputationPosted Oct 28, 2012, 8:24 PM EDT
Sandeep Singh ShekhawatRank #147 · 15.6K reputationPosted Oct 28, 2012, 8:35 PM EDT
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
Satyapriya NayakRank #47 · 31.5K reputationPosted Oct 30, 2012, 12:17 AM EDT
http://blog.sqlauthority.com/2007/07/13/sql-server-2005-use-alter-database-modify-name-instead-of-sp_renamedb-to-rename/