Uncategorized SQLException, incorrect syntax near '-' encountered during installation to MS SQL database in Azure cloud
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
Database problems were encountered during installation.
While installing Confluence on a virtual server in the Azure cloud, and using an MS SQL database, errors were encountered. During the setup, the test connection to the database was successful and some of the db tables were created, but during the process the error below is observed.
- Confluence 7.11.2
- MS SQL Server
The following message will appear in the logs:
"StatementCallback; uncategorized SQLException for SQL [CREATE TRIGGER confluenceschema.denormalised_space_trigger ON SQLDB01.confluenceschema.SPACES AFTER INSERT, UPDATE, DELETE AS BEGIN SET NOCOUNT ON; if (confluenceschema.space_function_for_denormalised_permissions() = 1) BEGIN INSERT INTO DENORMALISED_SPACE_CHANGE_LOG (space_id) select SPACEID from inserted; INSERT INTO DENORMALISED_SPACE_CHANGE_LOG (space_id) select SPACEID from deleted; END END ]; SQL state [S0001]; error code ; Incorrect syntax near '-'.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '-'."
The Confluence database has dashes ("-") in the database's name; this is a requirement of MS SQL Server to not allow dashes in the db's name (not a Confluence requirement).
Microsoft: Database Identifiers states what is allowed:
- Letters as defined in the Unicode Standard 3.2.
- Decimal numbers
- The at sign (@), dollar sign ($), number sign (#), or underscore (_) are allowed
Do not use dashes ("-") in the name of the Confluence database.