Issue:
ARM (Azure Resource Manager) API does not support specific T-SQL resource naming formats and that's why when Databases are created using T-SQL/SSMS, unsupported characters could get allowed into the names.
Azure Portal UI does not have this issue, because when you use Portal UI for creating a Database, the creation goes through ARM, and hence when unsupported characters are entered in the Name field, it immediately throws error, as shown in the below image.
Therefore, this issue of allowing unsupported characters in the DB name is present in one specific create scenario: i.e., when customer creates database using SSMS/T-SQL command. As this create does not go through the ARM, hence it’s not being restricted by ARM rules.
Details:
Officially an Azure SQL Database resource name should not contain certain symbols:
https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#micros...
- Can't use: < > * % & : \ / ? or control characters
- Can't end with period or space.
But not all of this restrictions are Applied when database is created using T-SQL command from master database. This is done to preserve consistency between on-prem Sql Server and Azure Sql databases. https://learn.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers?view=sql-s...
Workaround for customers:
Database is still operational from T-SQL perspective, but if you want to be able to manage it from outside of T-SQL, then the only way is to rename database using T-SQL command to not have the unsupported characters in it's name:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.