Rename SQL Azure database?

后端 未结 7 1103
南旧
南旧 2020-12-08 09:04

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 avail

相关标签:
7条回答
  • 2020-12-08 09:48

    I can confirm the

    ALTER DATABASE [oldname] MODIFY NAME = [newname];
    

    works without connecting to master first BUT if you are renaming a restored Azure database; don't miss the space before the final hyphen

    ALTER DATABASE [oldname_2017-04-23T09 -17Z] MODIFY NAME = [newname];
    

    And be prepared for a confusing error message in the Visual Studio 2017 Message window when executing the ALTER command

    Msg 0, Level 20, State 0, Line 0
    A severe error occurred on the current command.  The results, if any, should be discarded.
    
    0 讨论(0)
提交回复
热议问题