Omnitracker -extraction of attachments

Here is magic query to extract all attachments from Omnitracker and their physical storage.


select request,
'path_to_your_attachments\'+substring(filename_on_disk,1,2)+'\'+
substring(filename_on_disk,3,2)+'\'+
substring(filename_on_disk,5,2)+'\'+filename_on_disk+'.'+
substring(orig_name,len(orig_name)-2,3) as fileOnDisk,
orig_name
from
(
SELECT [id],
CONVERT(varchar(MAX),CONVERT(VARBINARY(8),id),2) as filename_on_disk
,[request]
,[orig_name]
FROM [Attachment]
where request in (617674,760232,...))a

requests_id can be retrieved from this query:

select request from UserFields1 where f19_titel="your title of Incident/RFC/Problem"

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *