You are viewing limited content. For full access, please sign in.

Question

Question

SQL table with .tif file names?

SDK
asked on January 21, 2016

We have a client who wants to search for the tif file name in SQL. They cant find it in the windows folder structure. Does anyone know if any tables have that field? so for example the file path does not exist but they know the file name is 000005A7.tif

 

Thanks in advance for any direction!

0 0

Answer

SELECTED ANSWER
replied on January 21, 2016 Show version history

Ben,

Each page of a document is stored as its own tif image.  So for example a five page document will actually have five different tif images associated with it.  In your example the filename '000005A7.tif' could actually represent just one page of a multi-page document, not the entire document (unless it is a single page document). 

That being said, here is a SQL statement that will return the path of the image if you supply the hex filename for the tif image;

SELECT dbo.vol.fixpath + '\' +
SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),1,2) + '\' + 
SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),3,2) + '\' +
SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),5,2) + '\' +
CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2) + '.TIF' AS FullPathAndFilename
FROM dbo.doc  
LEFT JOIN dbo.toc ON dbo.doc.tocid = dbo.toc.tocid
LEFT JOIN dbo.vol ON dbo.toc.vol_id = dbo.vol.vol_id
WHERE CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), doc.storeid),2) = '000005A7'

(edit the value in the WHERE clause to look for different images);

4 0

Replies

replied on January 21, 2016

The name is the page ID as a hex number. They're in the Doc table as decimal numbers, so you'd need to convert it from one to the other.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.