仅使用 SQL 将图片插入 SQL Server 2005 图像字段 [英] Insert Picture into SQL Server 2005 Image Field using only SQL

查看:39
本文介绍了仅使用 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 图像字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆