How to Store Image in Sql Server Database Tables Column [Duplicate]
I Have a Table Named Female in My Database. It Has Id as Primary Key, It Has an Image Column. My Question Is How Do I Store an Image Using a Sql Query? 1 2...
I Have a table named FEMALE in my database. It has ID as Primary Key, it has an Image column.
My Question is how do I store an image using a SQL Query?
give this a try,
insert into tableName (ImageColumn)
SELECT BulkColumn
FROM Openrowset( Bulk 'image..Path..here', Single_Blob) as img
INSERTING
REFRESHING THE TABLE
Insert Into FEMALE(ID, Image)
Select '1', BulkColumn
from Openrowset (Bulk 'D:\thepathofimage.jpg', Single_Blob) as Image
You will also need admin rights to run the query.