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

SSIS to extract photos in correct jpg format Expand / Collapse
Author
Message
Posted Wednesday, August 8, 2012 1:21 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, January 17, 2014 2:46 AM
Points: 18, Visits: 138
The job is to extract the photos from the SQL table into .jpg format.

I have created an SSIS package and used an Export column to extract the photos. I used a derived column to give the extention as .jpg

Apparently , even though the photos are being extracted with an extension of .jpg , its actually not .jpg but .bmp.

Any idea how we extract the photos in valid .jpg format ?
Post #1341705
Posted Wednesday, August 8, 2012 1:46 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, October 13, 2014 6:42 AM
Points: 5,216, Visits: 5,111
Was the binary data uploaded as a jpg or a bmp?



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1341709
Posted Wednesday, August 8, 2012 2:51 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, January 17, 2014 2:46 AM
Points: 18, Visits: 138
I am afraid I dont know .. thats the legacy data ..
Post #1341734
Posted Wednesday, August 8, 2012 3:07 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, October 13, 2014 6:42 AM
Points: 5,216, Visits: 5,111
Well more than likely was inserted as BMP, so you would need to extract them and convert them in a picture editor and re-upload them to the DB.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1341744
Posted Wednesday, August 8, 2012 4:03 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, January 17, 2014 2:46 AM
Points: 18, Visits: 138
Yeah agree.. but imagine if we have almost 500K pictures to convert .. What would be the best approach then ?
Post #1341767
Posted Wednesday, August 8, 2012 4:07 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, October 13, 2014 6:42 AM
Points: 5,216, Visits: 5,111
cant help you on that, thought it would have to be manually 1 by 1 as you will need to open the files and save them as jpg then re-upload





Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1341769
Posted Wednesday, August 8, 2012 4:27 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 5:41 AM
Points: 1,191, Visits: 9,886
You'd have to either:

1) Use a script transformation task (this is just pure .Net code), then just use one of the examples of converting a bmp file to a jpg in code

2) Save them as a .bmp, then shell out to a command line utility to do the same thing
Post #1341774
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse