To install sql-server-regex, you need to:
- Download or fork this code.
- Enable CLR
- Install the sql-server-regex assembly
- Create the T-SQL functions
Note: this requires sysadmin privileges on your SQL Server instance.
You need to enable CLR on SQL Server before you do anything else.
exec sp_configure 'clr enabled', 1
go
reconfigure
go
- Download load-assembly.sql.
- Download the sql-server-regex 2016 DLL.
- Copy both to the server you want to install sql-server-regex onto.
- Open load-assembly.sql, and set the value of @AssemblyLocation to the location of the sql-server-regex-2016.dll.
- Run the script.
Note: if you want to compile the assembly yourself from code, go ahead. Make sure your target platform is the version of SQL Server you want (e.g. SQL Server 2016), and that you copy the DLL that's created to the install location in step 3, above.
The final step is to create the scalar and table-valued functions that you can query using T-SQL.