This topic explains how to install the Microsoft SQL Server PremiumStats CLR functions. You may need to install these functions as part of setting up a SQL Server installation with a Premium Edition of LabKey Server.
PremiumStats is a CLR (Common Language Runtime) assembly with aggregate functions supporting LabKey Premium summary statistics
, including median, median absolute deviation, quartiles, and interquartile ranges. Microsoft SQL Server does not support these natively, so LabKey requires a CLR assembly to implement these capabilities.
This assembly and functions are typically installed automatically as part of the regular LabKey installation process. However, the process can fail if, for example, the database user does not have permission to install CLR assemblies. In these cases, a database administrator needs to install the assembly manually.
On a workstation with a connection to the Microsoft SQL Server Database Server:
- If the automatic installation has failed, site administrators will see a banner message on the running server reading "The premium aggregate functions are not installed. These functions are required for premium feature summary statistics." with two links.
- Click Download installation script in the banner message to download the required script: "premiumAggregatesInstall.sql"
- Click View installation instructions in the banner message to open to this topic.
- Connect to the Microsoft SQL Server using an account with membership in the sysadmin role.
- Execute the downloaded SQL script in the database.
- Confirm that PremiumStats is installed in the core schema.
- Restart Tomcat. The changes to the database will be recognized by the server only after a restart.