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?
If you are using SQL Server, you can set the database to single-user mode to close any open connections and prevent other users from connecting while you are changing the database name. In Object Explorer, expand Databases, right-click the database to rename, and then select Rename.
Using SQL Server Management Studio You may need to modify the SELECT statement in the SQL pane to return the rows to be modified. In the Results pane, locate the row to be changed or deleted. To delete the row, right-click the row and select Delete. To change data in one or more columns, modify the data in the column.
Just so people don't have to search through the comments to find this... Use:
ALTER DATABASE [dbname] MODIFY NAME = [newdbname]
(Make sure you include the square brackets around both database names.)
Please check that you've connected to master database and you not trying to rename system database.
Please find more info here: https://msdn.microsoft.com/en-US/library/ms345378.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With