Help Desk Manager Failing to install or upgrade due to SQL errors

Last Modified

Mon May 11 11:48 GMT 2020

Description

  • Certain Database Collation models have a case-sensitive requirement for variables within SQL scripts.
    • For example: Latin1_General_BIN
  • If unsure of your current model you can test your database collation model by :
    1. Opening MS SQL Server Management Studio and connecting to your instance.
    2. Creating a new query declare a @Variable then try to call it as @variable.
    3. If this gives errors saying @variable is not declared you should pursue the solution before next upgrade.
  • If you've already suffered an upgrade failure symptoms are as follows :
    • Installer Error : HDM Upgrade Failures: "failed to start wgdapplication", reason db_init_failed. 50002 SQL state code, SQL Error 137.
    • WHDSpring.log Error : 2020-04-16 00:26:00.892 [ApplicationManager-2] ERROR c.s.w.s.a.i.WhdApplicationManagerImpl - Failed to start WHD application. Reason: DB_INIT_FAILED com.microsoft.sqlserver.jdbc.SQLServerException: Must declare the scalar variable "@timeZone".

Environment

  • Help Desk Manager - Running On Microsoft SQL Databases
  • N-able N-central

Solution

  • To ensure case insensitive handling of SQL scripts choose a more common collation model.
    • For example: Latin1_General_CI_AS
  • If you have discovered your current collation model is indeed case sensitive then the best move is to prepare an instance which is not, and then migrate your data into this new instance.
    • There are a number of ways to backup and restore or perform migration on your database, the best approach here is to research for your version of Microsoft SQL.
    • NOTE: Recovery Points should be considered here with backups saved and on-hand throughout this procedure.