41

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?

4

2 回答 2

63

试试这个,

insert into tableName (ImageColumn) 
SELECT BulkColumn 
FROM Openrowset( Bulk 'image..Path..here', Single_Blob) as img

插入

在此处输入图像描述

刷新表

在此处输入图像描述

于 2013-03-27T13:27:22.553 回答
12
Insert Into FEMALE(ID, Image)
Select '1', BulkColumn 
from Openrowset (Bulk 'D:\thepathofimage.jpg', Single_Blob) as Image

您还需要管理员权限才能运行查询。

于 2013-12-02T08:36:56.313 回答