Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 insert/update image files from network location

Author  Topic 

dbarkley
Starting Member

1 Post

Posted - 2012-10-12 : 11:33:38
I know your should not store pictures in a SQL table but I have a need to do this.
Here is what I have.
Col1 - part number
Col2 - Part Description
Col3 - Part Image

the images are stored on a network location, lets says
\\server1\images\partnumber.jpg

How can I update all of part images using (col1)partnumber in the network location?

So if my part number in col1 is 12345 I want to go out to the network location \\server1\images\ and insert\update the col3 with the picture 12345.jpg.

I am trying but I can not seem to find a way to do this.
Any help would be great.

Mike Jackson
Starting Member

37 Posts

Posted - 2012-10-17 : 08:54:05
Why don't you just store the reference to the file in col3?

Mike
Go to Top of Page

Ifor
Aged Yak Warrior

700 Posts

Posted - 2012-10-17 : 09:07:05
I think most people would use either c# or powerShell to do this. You could also look at SSIS.

If you want to use t-sql, you could look at adapting the following:

http://www.sqlservercentral.com/blogs/practicalsqldba/2012/03/15/importing-images-to-sql-server-database-using-t-sql/
Go to Top of Page
   

- Advertisement -