Best practices for Relativity scripts
This page contains the following information:
- Verify your security permissions
- Avoid errors and performance issues
- Upgrade scripts for database schema changes
- Contact Support when necessary
We recommend that only Relativity and SQL experts who are familiar with XML be in charge of creating, testing, maintaining, and altering Relativity scripts.
You must have the appropriate system admin permissions to work with scripts. For more information, see Security and Permissions on the Relativity 9.6 Documentation site.
Any statement that can be written in SQL can be written into a Relativity script. In theory, you could create a script that completely erases your workspace's document table.
In addition, some scripts can negatively impact system performance if run during peak hours.
You can avoid these problems by:
- Allowing only experts to write scripts
- Allowing only experts to run scripts
- Testing scripts in test workspaces only, not in those being used for an actual case
Relativity occasionally makes changes to the database schema. Accordingly, not all scripts work on all versions of Relativity. If upgrading to a new version, you may need to update your references.
To test whether your script references need updating, run the SQL portion of the script in SQL Server Management Studio. If the script fails, it will throw an error message and attempt to identify the problem. If it succeeds, it will either advise you how many rows were affected or return the rows queried for.
If you have a Relativity test instance, deploy the latest version and test your scripts prior to upgrading the production environment.
Relativity Client Services is available to assist with any questions, comments, or concerns. Contact Client Services at firstname.lastname@example.org.
If you are writing scripts, we recommend that you attend infrastructure training to learn more about Relativity architecture. For more information, see Relativity Infrastructure Training.