Explore Courses Blog Tutorials Interview Questions
0 votes
in Azure by (20.3k points)

How can I rename the database in sql Azure?

I have tried 

Alter database old_name {MODIFY NAME = new_name} 

but not worked.

Is this feature available in SQL Azure or not?

1 Answer

0 votes
by (47.2k points)

You can Rename the database using command Line(TSQL) or using GUI(SSMS)

Rename using TSQL:

  • Connect to Azure Database Server using SSMS(SQL Server Management Studio)

  • Select the master database, right click on it and choose the new query

  • Now use alter command to rename the database,

 Alter Database [nameofdb] modify name = [newdbname].

Rename using GUI

  • Open SSMS

  • select database name and as the rename option from the dropdown will be grayed out and type with the new name.


Browse Categories