May 4, 2022 at 3:56 pm
Hello!
I am exporting images from database to the network path using SSIS - Export Column, I have two fields in the database that have images, this works as expected as long as both the fields have image. But sometimes one of the field might have image or not, how to use export Column in that scenario to export data when one field have image and other does not.
Thanks in advance.
May 4, 2022 at 4:02 pm
What happens when only one of the columns has an image?
May 4, 2022 at 4:15 pm
declare @path varchar(100)= 'c:\images\A\'
declare @path1 varchar(100)= 'c:\images\B\'
SELECT [ThumbNailPhoto],[ThumbNailPhoto1]
,@path+[ThumbnailPhotoFileName] AS Path
,@path1+[ThumbnailPhotoFileName] AS Path1
FROM [AdventureWorks2012].[Production].[ProductPhoto]
If ThumbNailPhoto is null and ThumbNailPhoto1 has image in the extract it is doing this:
c:\images\A\Pic.jpg ( size 0 KB)
c:\images\B\Pic.jpg ( size 1 KB)
It is still writing to A folder, what I would like is for the file to be created only when there is image on the field.
May 4, 2022 at 4:21 pm
I got it using case statement.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply