Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 images in sql

Author  Topic 

Kaler
Starting Member

4 Posts

Posted - 2012-02-25 : 08:33:16
I am relatively new to sql and I am wondering what is the best way to place image or pictures within an sql table. More precisly it is the format for the field within the table that I am unsure about. I have read about BLOB() but not sure how to incoroprate this tbh. The end game is to create a table that I can access th images to place them onto a webpage. Please help

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-25 : 11:11:07
you can use varbinary(max) to store images.

see how you can do it below

http://www.databasejournal.com/features/mssql/article.php/3724556/Storing-Images-and-BLOB-files-in-SQL-Server-Part-2.htm

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kaler
Starting Member

4 Posts

Posted - 2012-02-28 : 14:20:50
ty very much, just what I needed:)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-28 : 15:15:32
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-28 : 16:12:10
..and the Real answer is NO

Store the file path and file name of the image in the database, store the image on a file server

water closet

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

InNomina
Starting Member

40 Posts

Posted - 2012-02-28 : 18:34:27
I agree, storing images in a database will cause it's growth to become huge in no time.

X002548 has the best practice suggestion below...

quote:
Originally posted by X002548

..and the Real answer is NO

Store the file path and file name of the image in the database, store the image on a file server

water closet

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/








-------------------------
"If you never fail, you're not trying hard enough"
Go to Top of Page
   

- Advertisement -