Compression/Decompression of values in Database

  • I want to compress the values and insert/update to table and when selecting the values I want to decompress it and select.

    Is there any functions/methods available in sql server 2005?. I can do it in Application side and send compressed values to database, but I want to do it in database itself.

  • Your description is pretty vague. Can you describe what you mean by compress/decompress. How about giving us some examples using SQL statements and sample data? It would help us help you quite a bit more.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • jagadish_sds (6/11/2008)


    I want to compress the values and insert/update to table and when selecting the values I want to decompress it and select.

    Is there any functions/methods available in sql server 2005?. I can do it in Application side and send compressed values to database, but I want to do it in database itself.

    you could create user defined functions for such things but client-side seems more appropriate for these things.


    * Noel

  • For example I get credit report as xml file and its around 6MB size. I can store it in database. Event I can zip (compress) and store it in Database the size of the credit report is very less.

    The zip/unzip I want to do it in database while inserting/updating/selecting the credit report, not in application.

  • do you know any specific user defined function for zip/unzip?

  • search for the xpFileUtils.dll :this provides a set of extended stored procedures which will help to decompress/compress data using LZ/L7 algorithm.

  • You would need to do the compress / decompress in a CLR stored procedure or in a CLR function. CLR would need to be used because you would be accessing an external DLL to do the compress/decompress. If you take this route you will need extensive testing, especially to look for memory leaks in the external DLL. If memory does leak, then eventually you will have to restart SQL to reclaim the memory.

    It would probably be safer to get the application to do the compress/decompress, as this will keep any memory leaks outside of SQL Server and safeguard your SQL Server SLA.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply