Solved

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

Posted on 2009-04-14
5
603 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now