Some functions for Microsoft SQL Server
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore Initial commit Apr 18, 2018
LICENSE Initial commit Apr 18, 2018
README.md Corrections. Apr 18, 2018

README.md

SqlCrl

Some functions for Microsoft SQL Server

Functions

Function Description
Unzip Unzip binary data

Unzip

SELECT master.dbo.Unzip(MyVarBinary) FROM MyTable;
SELECT CAST(master.dbo.Unzip(MyVarBinary) as Xml) FROM MyTable;

Installation

I prefer install this dll to master db because of accesing in any db.

Loading Dll

Load SqlCrl.dll to SQL Server db from Programmability > Assemblies

Enabling Function

Run below command in master.

CREATE FUNCTION Unzip(@Input varbinary(max)) RETURNS varbinary(max)
AS EXTERNAL NAME [SqlCrl].[Zip].Unzip;

Enabling CRL Functionalty

sp_configure 'clr enabled', 1;
RECONFIGURE

Thanks

Jaime Olivares for ZipStorer http://github.com/jaime-olivares/zipstorer