Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images in SQL

Status
Not open for further replies.

zzfive03

Programmer
Jun 11, 2001
267
Can I store .gif and .jpg images in my SQL 2000 server? If so, how do I do this, and how do I retrive the data via SQL statment?


Thanks in advance.
 
SQL Server does have an Image datatype, so it is quite possible to store gif/jpg in the database. But the conventional wisdom is that most people store then outside the database in a directory folder.

Then, inside the database, you use a varchar column to contain a reference to where the image(s) is stored. i.e. this column might have a value of, say:

'c:\assets\images\tractor.jpg'

The reason for this is that the pictures clog up the data pages in the database, and the blob datatypes are not all that easy to deal with.

On the other hand, by storing the pictures outside the database, the OS then becomes responsible for security, permission, and backup of the picture files.

Does this help a bit?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top