gpt4 book ai didi

sql-server - SQL Server 2005/2008 : Insert a File in an varbinary(max) column in Transact-SQL

转载 作者:行者123 更新时间:2023-12-02 06:23:07 25 4
gpt4 key购买 nike

是否可以在 Transact-SQL 中的 varbinary(max) 列中插入文件?如果是的话,我会非常高兴有一个代码片段,至少让我知道如何做到这一点。

谢谢

最佳答案

这很简单 - 一旦您知道了! :-) 在 Greg Duncan's blog 上找到了这个不久前:

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

这是 MSDN library documentation就在上面。

马克

关于sql-server - SQL Server 2005/2008 : Insert a File in an varbinary(max) column in Transact-SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1212494/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com