Error Fix " Migration Failed: Incorrect syntax near the keyword 'IF' "

While trying to activate the Test Manager feature from Orchestrator 2022.10 it fail with error "Migration Failed: Incorrect syntax near the keyword 'IF' ".

Error is related to syntax that is not supported by SQL server 2014 or previous versions.

Below query is executed by the upgrade:

  • "DROP INDEX IF EXISTS [IX_TestCaseExecutionId] ON [ta].[TestCaseAssertions] "

According to Microsoft documentation DROP INDEX ( Transact SQL ) , "IF EXIST" argument can be used only started with SQL 2016 version.

Resolution:

  • Upgrade the SQL DB.

Note: Additional, in case of similar issues related to DB, during upgrade an SQL Profiler trace can be collected where all the commands run by upgrade will be displayed for further analysis.