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

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

问题描述

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

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天全站免登陆