Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Batch insert images into SQL Server with conditions Expand / Collapse
Author
Message
Posted Thursday, June 12, 2014 5:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, July 5, 2014 8:54 PM
Points: 4, Visits: 11
Hi!
Would you please help me here?
I want to insert some images base on their Picture IDs. Picture IDs are in the extension of files in a single folder.
Post #1579965
Posted Thursday, June 12, 2014 6:00 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 8:15 AM
Points: 13,017, Visits: 10,800
Can you give some example of what you are trying to do? Table ddl would be nice.

SSIS has the import column transformation, it may be worth checking that one out.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1579992
Posted Saturday, June 14, 2014 4:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, July 5, 2014 8:54 PM
Points: 4, Visits: 11

Hi!
Thanks. This is my case.
I want to import some images base on the PK_ID.
Thanks again.
Post #1580814
Posted Saturday, June 14, 2014 4:32 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, July 5, 2014 8:54 PM
Points: 4, Visits: 11
http://i.imgur.com/ggfwiEB.jpg
Post #1580815
Posted Monday, June 16, 2014 12:07 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 8:15 AM
Points: 13,017, Visits: 10,800
Did you try the SSIS import column transformation I mentioned earlier?

Importing Files Using SSIS




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1580997
Posted Monday, June 16, 2014 4:11 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, July 5, 2014 8:54 PM
Points: 4, Visits: 11
Well, I didn't actually.
Honestly, I haven't worked with SSIS.
Do you think that would help me? If it does, I would learn it.
Post #1581046
Posted Monday, June 16, 2014 4:16 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 8:15 AM
Points: 13,017, Visits: 10,800
It would satisfy your requirement yes.
You would only need to create the full path at which an image is located.

Currently only the last part of the filename is stored in the table.
I see for example 22068.jpg.61018_PICTURE.jpg in the screenshot, where 61018 is a PK stored in the table.
You'd need the first part as well.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1581048
Posted Monday, June 16, 2014 4:20 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 8:15 AM
Points: 13,017, Visits: 10,800
On the other hand, since you have not used SSIS yet, a small C# app might be easier:

Uploading Images to a Database ( C# ) – Part I

You would need to loop over all of the files in the folder, extract the PK and match it against the table.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1581050
Posted Thursday, August 7, 2014 5:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, August 11, 2014 4:34 AM
Points: 7, Visits: 11
I would like to say thanks Koen Verbeeck who share this link here. It is very helpful for me while insert images into SQL server.

magento development india | web programming india
Post #1600560
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse