Link to home
Start Free TrialLog in
Avatar of rascaal
rascaal

asked on

how can i import .jpg file to sql server 2000

Hello,
  I would like to import .jpg image files into a database on sql server 2000. Does anyone know how to do this?. Perhaps using a dts package?

Jim
Avatar of russellshome
russellshome

Are you sure you want to import image files into a database? Considering the JPEG format, I'm assuming you want to provide a web application. Often the DB Server is physically different to the web server. This means that each time one of these images is requested, it has to be transported over the network from db server to web server (very inefficient).

It is better to store a reference to the images in the database (e.g. file name).
rascaal:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
I gave the only answer, I should get all the points. Simple really c|:-)
ASKER CERTIFIED SOLUTION
Avatar of danblake
danblake

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Bulk insert can also be used from the T-sql command line with a format file.
danblake, sure it is possible but is it the best technique? You can tune the database, but how does that help the problem "it has to be transported over the network from db server to web server "?

It is less complex, more efficient and more robust to store the file in the file system and a reference to the file in the database.
That may be the case for some applications, we do not know this particular application enviroment.
Let the user decide with perf/monitoring of the application before/after.

It may be that replication of an image file is required to ensure all sites have the same image data across multiple sites.  This is one particular problem if moving files across sites to maintain a web-system, if this happens on a frequent basis -- I would rather add/drop sites invovled using replication (automated) than creating multiple destination output FTP setups (manually).

An image file is going to take up no more network bandwidth than any other data-feed from the system.  There is a lot of bandwidth on a 100 Mb/s network card if directly attached to a web-server.
Avatar of Anthony Perkins
>>Let the user decide with perf/monitoring of the application before/after.<<
I somehow suspect that the questioner is unlikely to return after more than a year MIA, so it is probably a moot point.
"It may be that replication of an image file is required " - Clustered web servers

"An image file is going to take up no more network bandwidth " - Compare "image.jpg" = 9 bytes to a small image of 20K, the image contains more than 2,000 times more data. Not to mention the overhead involved in extracting the data from SQL Server and then pushing it out to the browser. This overhead and network traffic is incurred every time the jpeg is requested.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.  

I will leave the following recommendation for this question in the Cleanup topic area:

Accept Answer From danblake


Any objections should be posted here in the
next 4 days. After that time, the question will be closed.

Arbert
EE Cleanup Volunteer
@arbert -- nice to see you've made it to the EE Volunteer Group..
I did it a long time ago, but it's soooo time consuming that I dropped back for a bit....

So no objections?  I agree with russellshome's comments above, but like I've seen you post before "sometimes people just want their question answered".  As long as the "may not be the best method" caveat is attached I tend to agree.....
"sometimes people just want their question answered". However, this web site is a great store of knowledge which I believe is enhanced with informed debates over the best technique to use.

If one is only interested in gaining "points" then it would most often be a waste of time to propose any other solution than that implied by the questioner...  I'm not worried about the points and would rather engage in debates - I have learnt a lot in this manner and hope others do too.