Updating the database with SQL scripts
Occasionally you need to update your database by running a SQL script. This is usually required when performing a software update (see
Updating Modules, available from
www.siriusware.com/docs).
Warning: Be sure to back up your database before running any SQL script provided to you by accesso Ensure that the script reports, “Query batch completed” at the bottom of the SQL Query analyzer results pane. If it reports, “Query batch completed with errors”, do not run any further update scripts and immediately contact accesso Siriusware Technical Support (you should save the entire text in the Results pane and send it to accesso Siriusware Technical Support as well). You must not restore your database unless accesso Siriusware Technical Support tells you to (it is important to preserve your back up until the problem is understood.)
To update your SQL Server 2008/2012 database with a SQL script:
1. You must run update scripts directly on the SQL server computer. In SQL Server Management Studio, from the main menu, click on File > Open File and browse to open the SQL update script that you have downloaded for the update. Log-in is required before the script can be opened. It is essential that you log into SQL Server with Windows Authentication (you must be on the server, not from a workstation) while you are logged into Windows as a user with Administrator rights or log into SQL Server as the, system administrator user (SA).
2. After the script is displayed, click on the dropdown list on the toolbar where master is shown by default to select the SiriusSQL database.
Note: If you are updating your training database, then select SiriusSQL_Training using the dropdown arrow. If your database is named something other than one of these default names, select it with the dropdown arrow.
3. Click on the Execute button right next to the database dropdown to run the script.
Note: The status of the process is displayed at the bottom of the Query window and at first reads Executing Query batch…
4. When the script is finished running, the status reads Query Executed Successfully.
Note: It may be necessary to run more than one script to update your database to the current version. Sometimes accesso provides you with a script that performs a collective update that can also be performed by executing the individual scripts.
If you are upgrading from one database to the very next iteration, you need only one script. However, if you are upgrading a few lettered versions back to the current version, you need a script for each lettered version.
Example:
If you have SiriusDB_4400c and the latest version is SiriusDB_4400d, you would need to run a single script: SiriusSQL_4400c_to_4400d.sql. However, if you have SiriusDB_4400a and the latest version is SiriusDB_4400d, you would need to run the following scripts:
SiriusSQL_4400a_to_4400b.sql
SiriusSQL_4400b_to_4400c.sql
SiriusSQL_4400c_to_4400d.sql
It is also vital that you back up your database after each script has been run, creating a new backup for each new database.
Note: If you need to run more than one script, create another backup of your database and repeat this section.
Note: If the status reads, “Query batch completed with error”, place the cursor in the bottom window that contains error messages and select File > Save As and save the errors to a file. Call accesso Siriusware Technical Support. Do not run any more scripts until the errors have been resolved and the script that just failed runs successfully.