How to Rename a Database Name in Sql Server 2005?

How to Rename a Database Name in Sql Server 2005?

Here is the sample code to do it.

for 2005,2000 versions
EXEC SP_RENAMEDB 'oldDB name', 'newDB name'

Supported in SQL Server 2005+
ALTER DATABASE "oldDB name" MODIFY NAME="newDB name"

No comments: