本文介绍了表中的图像存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生,

我有一张桌子,如下.

Hello Sir ,

I have a table as below.

CREATE TABLE Employ
(
    
    Name varchar(50) not null,
    Photo varbinary(max) not null,Id int
)





INSERT INTO Employ ( Name, Photo,Id) values
SELECT  ''John'', BulkColumn
FROM Openrowset( Bulk D:\Arvind@Work\Image\Blue hills.jpg, Single_Blob) as EmployeePicture ,10;



我想在此表中插入值,但这是错误的.你能帮我吗?

谢谢,
Arvind Kumar Singh



and I want to insert the value in this table But this is give error. Can you help me?

Thanks,
Arvind Kumar Singh

推荐答案

INSERT INTO Employ ( Name, Photo,Id) values
SELECT  'John', BulkColumn
FROM Openrowset( Bulk D:\Arvind@Work\Image\Blue hills.jpg, Single_Blob) as EmployeePicture ,10;




在sqlserver配置工具的外围应用配置上启用OpenRowset支持,然后将上述查询调整为




Enable OpenRowset Support on surface area configuration of sqlserver configuration tool, and then adjust the above query to

INSERT INTO Employ ( Name, Photo,Id)
SELECT  'John', EmployeePicture.BulkColumn
FROM Openrowset( Bulk D:\Arvind@Work\Image\Blue hills.jpg, Single_Blob) as EmployeePicture ,10;


CREATE TABLE Employees (   
                          Id int,   
                          Name varchar(50) not null, 
                          Photo varbinary(max) not null 
                       )  

INSERT INTO Employees (Id, Name, Photo)  SELECT 10, ''John'', BulkColumn  FROM Openrowset( Bulk ''C:\photo.bmp'', Single_Blob) as EmployeePicture


这篇关于表中的图像存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 03:43