storing images in sql server

how to store images in sql server 2003 database

Page 1 of 1

3 Replies - 3527 Views - Last Post: 04 January 2010 - 12:33 AM Rate Topic: -----

#1 javedparamount  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 28-July 09

storing images in sql server

Posted 03 January 2010 - 11:34 PM

on front end i am using vb.net 2005 and back end sql server 2003. i want to store images in my database but not know how to achieve it. please somebody help me.

may b images will b stored on web server and there will b links for images in database

This post has been edited by javedparamount: 03 January 2010 - 11:39 PM

Is This A Good Question/Topic? 0
  • +

Replies To: storing images in sql server

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4399
  • View blog
  • Posts: 12,255
  • Joined: 18-April 07

Re: storing images in sql server

Posted 03 January 2010 - 11:58 PM

Simple answer, you don't. Don't store images directly in your database. You can store a path to the file on the file system, but never store the actual binary in a database. It makes your database bloated, bulky, hard to edit and can destroy performance on things like searching etc. Do yourself a favor and try to avoid storing them in the database itself. You will be glad you did. :)
Was This Post Helpful? 0
  • +
  • -

#3 javedparamount  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 28-July 09

Re: storing images in sql server

Posted 04 January 2010 - 12:30 AM

View PostMartyr2, on 3 Jan, 2010 - 10:58 PM, said:

Simple answer, you don't. Don't store images directly in your database. You can store a path to the file on the file system, but never store the actual binary in a database. It makes your database bloated, bulky, hard to edit and can destroy performance on things like searching etc. Do yourself a favor and try to avoid storing them in the database itself. You will be glad you did. :)


well i dont know how to store path of image in database and how to retrieve images with corresponding records
Was This Post Helpful? 0
  • +
  • -

#4 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1877
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Re: storing images in sql server

Posted 04 January 2010 - 12:33 AM

You would just store the name of the image like chris_picture.jpg then retrieve that and output it in your web page/application with the path appended to it.

So store the image on the server first, then store the name of the image in the database, then retrieve the name of the image from the database and output it in URL/path
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1