Solved

How to read metadata of JPEG using T-SQL?

Posted on 2014-01-10
3
504 Views
Last Modified: 2014-01-21
I've uploaded some JPEG images to a filestream column in SQL Server 2008. I want to extract the metadata from these into another table containing columns that represent each item of metadata. I'm not sure about the structure of metadata though. When I place my cursor over a photo icon in Explorer a caption appears containing five items (date taken, dimensions etc). Is this all there is, or are there more items of metadata embedded in the file?

Secondly, how can I read this data using T-SQL?
0
Comment
Question by:TimHudspith
3 Comments
 
LVL 12

Accepted Solution

by:
ktaczala earned 500 total points
ID: 39772895
Here's a link for metadata: http://www.exiv2.org/tags.html

Attached is some code I use to get some of that info.
Metadatacode.txt
0
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39773200
it may be a little difficult to do it in database itself...
but it will be easy to do it as a .NET library using the below approach

http://msdn.microsoft.com/en-us/library/xddt0dz7(v=vs.110).aspx

So, what I suggest is to create a library to get the metadata using .NET using the above approach and use SQLCLR to add this library and act on the input JPEG and populate your tables.

that should be an easy one rather finding the whole stuff in TSQL.
0
 

Author Comment

by:TimHudspith
ID: 39787751
ktaczala - I want to use your code inside a loop that iterates the rows of my SQL Server table containing the photos. The problem is that I can't set the SqlFileStream object. I've set this up as a separate question:

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_28341070.html
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change this SQL to get all nodes 3 41
Applying Roles in Common Scenarios 3 22
Running Total Using new MS SQL Function 21 53
Need SQL Update 2 11
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

696 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