愿所有的美好和期待都能如约而至

仅使用 SQL 将图片插入 SQL Server 2005 图像字段

发布时间:  来源:互联网  作者:匿名  标签:error Insert Picture into SQL Server 2005 Image Field using only SQL exception i  热度:37.5℃

本文介绍了仅使用 SQL 将图片插入 SQL Server 2005 图像字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 SQL Server 2005 和 Management Studio 如何将图片插入表的 Image 类型列?

Using SQL Server 2005 and Management Studio how do I insert a picture into an Image type column of a table?

最重要的是我如何验证它是否存在?

Most importantly how do I verify if it is there?

推荐答案

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

这篇关于仅使用 SQL 将图片插入 SQL Server 2005 图像字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,

勇敢去编程!

勇敢的热爱编程,未来的你一定会大放异彩,未来的生活一定会因编程更好!

TOP