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