Solved

How to save .bmp, .jpeg, .jpg file in ms sql 2005?

Posted on 2009-04-14
5
627 Views
Last Modified: 2012-05-06
Hi, Experts....
How can save or update image files in ms sql 2005? i am using ms visual basic.net. i have set my database field with ImagePath and datatype as image.

How about if i want manually insert the image in ms sql 2005 without code? thank you.

regards
chkueh
0
Comment
Question by:chkueh
  • 2
5 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 24136690
Although I am out of context with your question but I have not been storing images in the database as it is not considered a good and optimal solution. Read these following two links:
http://databases.aspfaq.com/database/should-i-store-images-in-the-database-or-the-filesystem.html
http://www.dbazine.com/sql/sql-articles/larsen13
0
 
LVL 13

Accepted Solution

by:
kaylanreilor earned 500 total points
ID: 24543783
There are 2 options : BULK INSERT or TEXTCOPY.

With TEXTCOPY you have http://www.mssqlcity.com/Articles/KnowHow/Textcopy.htm
By the way, you should insert something into text/image column before copy text/image into it. I mean, this value should not be null. You should write (for example):
C:\>TextCopy /S SIDEVDESKTOP /D pubs /T pub_info /C Logo /F c:\sample.jpg /W "
WHERE pub_id=0736 " /I /U sa /P

Nevertheless, I would advise to do a BULK copy instead : http://msdn.microsoft.com/en-us/library/aa173839(SQL.80).aspx
In the end the SQL query can be :
BULK INSERT pubs..bitmap FROM 'c:\test.doc'
WITH (
   FORMATFILE = 'c:\Bcp.fmt'
)
0
 
LVL 13

Expert Comment

by:kaylanreilor
ID: 24932383
It is not because chkueh finally doesn't need any solution anymore that the issue itself is not valid for experts-exchange readers. Suddendly chkueh decides he doesn't want to "manually" insert the images into the DB then the answers have been worked and posted for nothing ?!
The question has been asked, the answers have been given and are valid, so they should be tagged as the solution. Just cancel it without any reason is not correct.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question