TRAIN TRACK"

Run a Script and Update Tables

Q: How do I run a script and update the tables?

A: To run the script and update your database, please follow these steps:

Make a backup of your database

1. Open SQL Management Studio and locate your TRAIN TRACK database in the navigation pane on the left.
2. Right-click on the name of your database, and in the pop-up box, select "Tasks > Backup".
3. In the pop-up window, select the destination and file name (it must be on the local drive).
4. Click "OK".

Test the backup

1. Open SQL Server Management Studio.

2. In the tree at the left, right-click on "Databases" and select "New". Type in a database name and click "OK". (for example, TRAINTRACKTestRestore200801)

3. Right-click on the database and select "Tasks > Restore > Database". A pop-up window will open.

4. In the window, from the "General" page, select the "Device" radio button.

5. Click the elipse (...) button. In the pop-up window, select "Add" to browse to the.bak file created previously. Click "OK"

6. In the "Destination" section, update the database name to the name of the database you are restoring to (double-check this step as it may revert to the original database name).

7. From the "Options" page, check "Overwrite the existing database/REPLACE".

8. Un-check "Tail-Log Backup" if it is checked.

9. Click "OK". You should see a message that the database was restored.

 

If the file fails to restore, click on the error message for the reason and correct the specified setting. Contact us for assistance if you are unable to restore your backup.

Run the script

MAKE SURE YOU HAVE CREATED AND TESTED A BACKUP COPY BEFORE RUNNING A SCRIPT!

1. Download the script.
2. Right-click on the zip file and in the pop-up box select "Extract all". Note the location of the extracted file.
3. Open SQL Management Studio and from the menu bar select "File > Open > File" and navigate to the saved script.
4. Once the script file is open, near the top of the code, replace "USE[TRAINTRACK]" with "USE[MYDATABASE]" if your database is not named "TRAINTRACK".
5. From the menu bar, click "Execute" (a red exclamation icon or a green arrow icon, depending on your SQL version).
6. You should see a message that the execution was successful.

If you see a message that the script completed with errors, please double-click on the error so that the portion of code is highlighted above, and take a screen image of both the code section and the error message (by clicking Alt + PrtScn) and send this to us for assistance.

Refresh linked tables from the client interface

1. Open TRAIN TRACK from your workstation.
2. From the Menu Bar, Database Administration tab, click on "Lined Table Manager". Note: in version 10 and earlier, from the Start Menu, click on the DATABASE tab, then "Linked Table Manger".
3. Click "Select All" and then click, "OK".
4. You should receive a message saying "All selected tables were successfully refreshed". Click OK and re-start TRAIN TRACK.

Repeat this section for each client workstation.