sql-serverazure-sql-database

How to Rename a Azure SQL Server


How to rename an Azure SQL Server?

I created a dummy Azure SQL Server called 'changename' and I would like to rename the server to 'newname'.

I tried the following:

EXEC sp_dropserver 'changename';
GO
EXEC sp_addserver 'newname', local;
GO

But I got the following errors:

Could not find stored procedure 'sp_dropserver'.
Could not find stored procedure 'sp_addserver'.

Any thoughts?


Solution

  • Once created an Azure SQL logical server cannot be renamed.

    My suggestion is to create a new SQL Azure Database server with the new name you wanted to assign to the old server logical server, then copy all databases to the newly created server, finally remove the old server.