Solved

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

Posted on 2009-04-14
5
640 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Open a link in vb.net 2 25
Convert Ctime to date time in textfile? 7 62
Need help converting bitmap to image in VB.Net 8 44
Get sourcecode path 14 46
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 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