Delete User Script

Included in the Totalview installation is an SQL script to delete all information about a user. It is strongly advised against using this script unless it is absolutely strictly necessary to delete all traces of information that can be linked to a person. Think GDPR.
For normal operations it is sufficient to use the user delete function in Admin module.

Prerequisite

SQL Server Command Line Tool sqlcmd must be installed on Totalview Server. Can be dowloaded from Microsoft website. To verify: Open cmd and run sqlcmd -? It should output version number and command line usage.

../../_images/sqlcmd_minus_question.png

Get User’s ID

Open Totalview Client and right click on the user that is to be deleted. In the popup context menu, under Details, the Rec Id is the user’s ID, that is to be used a input to the script.

../../_images/tvclient_user_recid.png

Execute the Script

1. Stop all Totalview Services

2. Take Backup of Database

3. Run SQL Script

sqlcmd -U <db userid> -S <db server name> -d <database name> -v resourceid=<user id to be deleted> -i <path to deleteresource.sql script>

Example:

sqlcmd -U sa -S localhost -d totalviewdb -v resourceid=6187 -i “C:\Program Files (x86)\formula.fo\Totalview3\Misc\deleteresource.sql”
../../_images/sqlcmd_execute_deleteresource.png

4. Start Totalview Services