Home > DeveloperSection > Articles > Store image in SQL Server database

Store image in SQL Server database

Posted by  Arun Singh
on    July-15-2011 18:55 PM

Database Database 
Ratings:
0 Comment(s)
 4993  View(s)
Rate this:

Store Image in SQL Server Database

SQL server offers to store image in database. Actually when we want to explore information for appropriate image then it is the best option to store image in database with appropriate information. And it is also cost effective in using webhosting.

To store image in database first we have to create a table which contain an image. Let’s brief example to demonstrate how store image in database table with SQL query.

-----DEMONSTRATION OF SAVE IMAGE IN SQL SERVER DATABASE-----

 

CREATE TABLE SAVEIMAGE_TABLE

(

 IMAGEID INT,

 IMAGENAME IMAGE ----- IMAGE COLUMN NAME WHICH CONTAIN IMAGE

) 

Syntax: Save image in database table

---- SYNTAX DEMONSTRATION TO STORE IMAGE IN DATABASE TABLE

INSERT INTO <TABLE_NAME> VALUES ([COLUMN_NAME],[IMAGE_PATH WITH IMAGE NAME])

---- DEMONSTRATION TO STORE IMAGE IN DATABASE TABLE

INSERT INTO SAVEIMAGE_TABLE VALUES (101,'C:\Users\Sachindra\Desktop\aa.png')

Store Image in SQL Server Database
















Recent Activities

Kamlakar Singh added new Article Working with Web-SQL Database & HTML5   5 hours ago

Kamlakar Singh added new Blog Online and Offline Events in HTML5   5 hours ago


Sumit Kesarwani added new Question What is the serialization?   6 days ago

Don't want to miss updates? Please click the below button!