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)
 4807  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

samuel fernanandes Created New Discussion Working with sessions and POST   5 hours ago

Barbara Jones added new Question What is ANR?   4 days ago

Kamlakar Singh added new Blog Convert Text Document to PDF File   17 days ago

Kamlakar Singh added new Article Introduction to Backbone.js   17 days ago

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