• An hour later I have some bad news.

    As soon as I attempted to put a bit of a real load on the SQLCLR compresson and push through some real data, things exploded:

    Msg 6532, Level 16, State 49, Line 1

    .NET Framework execution was aborted by escalation policy because of out of memory.

    System.Threading.ThreadAbortException: Thread was being aborted.

    System.Threading.ThreadAbortException:

    at System.IO.MemoryStream.set_Capacity(Int32 value)

    at System.IO.MemoryStream.EnsureCapacity(Int32 value)

    at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)

    at System.IO.Compression.DeflateStream.InternalWrite(Byte[] array, Int32 offset, Int32 count, Boolean isAsync)

    at System.IO.Compression.DeflateStream.Write(Byte[] array, Int32 offset, Int32 count)

    at SqlClrTools.SqlCLRTools.fn_compress(SqlBytes blob)

    The statement has been terminated.