Solved

SQL Compression

Posted on 2011-09-15
6
219 Views
Last Modified: 2012-05-12
Hello Experts,

Is there a way to Compress data that will be stored as an "Image" field type? Are there pro's and con's? If so, what are they.

Here is my delema. I have 600+ employees who will need to upload 5 PDF files per employee and each PDF file is restricted to only allow 1MB per PDF file to be uploaded.

I was asked if there is a way to further compress those PDF files.
0
Comment
Question by:asp_net2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 30

Expert Comment

by:Rich Weissler
ID: 36542915
To answer the question asked: If you are using the tools to author the PDFs, you can sometimes use the tool to decrease the size of the file, for example (http://help.adobe.com/en_US/Acrobat/9.0/Standard/WS65C0A053-BC7C-49a2-88F1-B1BCD2524B68.w.html)

Some additional thoughts: If you are developing a new application... consider not using the IMAGE datatype.  It's deprecated, and expected to be dropped from SQL in a future version.

If you are developing a new application, and have the the option of building it using SQL 2008, and are storing 'largish' files like this... consider using FILESTREAMS.
0
 
LVL 4

Author Comment

by:asp_net2
ID: 36543047
Hi Razmus,

>> To answer the question asked: If you are using the tools to author the PDFs, you can sometimes use the tool to decrease the size of the file, for example (http://help.adobe.com/en_US/Acrobat/9.0/Standard/WS65C0A053-BC7C-49a2-88F1-B1BCD2524B68.w.html)

The average user will either NOT do this or will NOT no how :(

>> Some additional thoughts: If you are developing a new application... consider not using the IMAGE datatype.  It's deprecated, and expected to be dropped from SQL in a future version.

I'm current application is using SQL Server 2005. From what I read the "image" type was the best field type to use for storing PDF files. If you have a better / preferred method for SQL 2005 then please share your opinion.

>> If you are developing a new application, and have the the option of building it using SQL 2008, and are storing 'largish' files like this... consider using FILESTREAMS.

Correct, I see that the "image" field type is no longer supported for SQL Server 2008 but i'm not sure if I will be so lucky to be able to purchase another DB. Is FILESTREAMS the "image" type replacement?
0
 
LVL 30

Expert Comment

by:Rich Weissler
ID: 36543329
Unfortuntately PDFs tend to be pretty 'dense', and compression techniques tend not to do much for them.  Apparently there are some programmatic methods of doing the equivalent of opening the PDF, and cleaning them up so they shrink in size.  I believe one is built into the Adobe SDK, and there is a third part tool (as an example) here: http://www.leadtools.com/sdk/pdf/compress-image-pdf.htm

image is still supported in SQL 2008 -- it's just discouraged with the understanding that it'll be going away.  The equivalent replacement is varbinary(max).  That recommendation still applies in SQL 2005

FILESTREAM is a method of using the filesystem to store files/binary objects, with integrated links in the database.  (If you've ever worked with a system where folks store files in a share, then stores URLs for those files... this is a replacement for THAT.  And it keeps the files integrated into the backups, etc...)
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 4

Author Comment

by:asp_net2
ID: 36543680
Hi Razmus,

Not sure if FILESTREAM will work for me if I go to SQL Server 2008. I store ALL images and PDF's in the Database rather than the Filesystem and a link in the DB to the Filesystem. We create backups of our DB with 1hr increments so that is why we choose to store all images/pdf's in the DB.

What would you recommend that I use and why? Continue to use Image or VarBinary(max)?
0
 
LVL 30

Accepted Solution

by:
Rich Weissler earned 500 total points
ID: 36544160
If you are comfortable with what you are doing, and it performs adequately for your purposes, go with what you are doing.. but if it isn't too late to change the datatype, switch the Image to VarBinary(max).
0
 
LVL 4

Author Closing Comment

by:asp_net2
ID: 36544446
Thank you!!!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question