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
Solved

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

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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