SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Compression/Decompression of values in Database


Compression/Decompression of values in Database

Author
Message
jagadish_sds
jagadish_sds
Old Hand
Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)

Group: General Forum Members
Points: 344 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.
John Rowan
John Rowan
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21490 Visits: 4600
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
noeld
noeld
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35482 Visits: 2051
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
jagadish_sds
jagadish_sds
Old Hand
Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)

Group: General Forum Members
Points: 344 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.
jagadish_sds
jagadish_sds
Old Hand
Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)Old Hand (344 reputation)

Group: General Forum Members
Points: 344 Visits: 45
do you know any specific user defined function for zip/unzip?
koustav_1982
koustav_1982
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

Group: General Forum Members
Points: 481 Visits: 194
search for the xpFileUtils.dll :this provides a set of extended stored procedures which will help to decompress/compress data using LZ/L7 algorithm.
EdVassie
EdVassie
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23194 Visits: 3916
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 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005. 14 Mar 2017: now over 40,000 downloads.Disclaimer: All information provided is a personal opinion that may not match reality.Quote: 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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search