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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 insert/update image files from network location
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dbarkley
Starting Member

1 Posts

Posted - 10/12/2012 :  11:33:38  Show Profile  Reply with Quote
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 - 10/17/2012 :  08:54:05  Show Profile  Reply with Quote
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 - 10/17/2012 :  09:07:05  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000