Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-04-14
5
Medium Priority
?
655 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 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

886 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