Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Compression/Decompression of values in Database Expand / Collapse
Author
Message
Posted Wednesday, June 11, 2008 4:14 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, October 15, 2009 12:32 AM
Points: 14, Visits: 45
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.
Post #515568
Posted Wednesday, June 11, 2008 4:33 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, October 23, 2013 12:46 PM
Points: 3,843, Visits: 3,833
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 - by Jeff Moden
Post #515577
Posted Friday, June 13, 2008 9:07 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, April 01, 2014 8:03 PM
Points: 6,266, Visits: 2,027
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
Post #516810
Posted Friday, June 13, 2008 5:52 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, October 15, 2009 12:32 AM
Points: 14, Visits: 45
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.
Post #517115
Posted Friday, June 13, 2008 5:54 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, October 15, 2009 12:32 AM
Points: 14, Visits: 45
do you know any specific user defined function for zip/unzip?
Post #517116
Posted Thursday, June 26, 2008 7:00 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Saturday, March 08, 2014 5:07 PM
Points: 72, Visits: 180
search for the xpFileUtils.dll :this provides a set of extended stored procedures which will help to decompress/compress data using LZ/L7 algorithm.
Post #524669
Posted Friday, June 27, 2008 2:25 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, April 14, 2014 3:21 AM
Points: 2,797, Visits: 3,079
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: SQL Server FineBuild 1-click install and best practice configuration of SQL Server 2014, 2012, 2008 R2, 2008 and 2005. 25 March 2014: now over 28,000 downloads.
Disclaimer: All information provided is a personal opinion that may not match reality.
Concept: "Pizza Apartheid" - the discrimination that separates those who earn enough in one day to buy a pizza if they want one, from those who can not.
Post #524824
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse