?
Solved

How to read metadata of JPEG using T-SQL?

Posted on 2014-01-10
3
Medium Priority
?
562 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 13

Accepted Solution

by:
ktaczala earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

809 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