articles

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

Store image in SQL Server database

Anonymous User14849 15-Jul-2011

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



Updated 07-Sep-2019
I am a content writter !

Leave Comment

Comments

Liked By