I've a table in MS Sql server with an image field and a file. What is the easiest way to create a T-Sql script that updates the field with the content of the file?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
UPDATE YourTable
SET BlobColumn =
(SELECT BulkColumn FROM OPENROWSET(BULK N'C:\YourFile.png', SINGLE_BLOB) AS x)
WHERE ...