SQL Server 2005/2008:在Transact-SQL的varbinary(max)列中插入文件 [英] SQL Server 2005/2008: Insert a File in an varbinary(max) column in Transact-SQL

查看:103
本文介绍了SQL Server 2005/2008:在Transact-SQL的varbinary(max)列中插入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Transact-SQL的varbinary(max)列中插入文件?如果是的话,请提供一个代码片段,至少可以让我知道如何做到这一点.

Is it possible to insert a file in a varbinary(max) column in Transact-SQL? If yes, I would be very please to have a code snippet to at least give me an idea how to do that.

谢谢

推荐答案

这很容易-只要您知道! :-)在 Greg Duncan的博客中找到了前一段时间:

It's so easy - once you know it! :-) Found this on Greg Duncan's blog a while ago:

INSERT INTO YourTable(YourVarbinaryColumn)
    SELECT * FROM 
    OPENROWSET(BULK N'(name of your file to import)', SINGLE_BLOB) AS import

这是 MSDN库文档.

马克

这篇关于SQL Server 2005/2008:在Transact-SQL的varbinary(max)列中插入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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