简体   繁体   中英

How insert Image from a directory path in my computer into SQL Server binary column with T-SQL with WHERE clause

I need to insert an image from a path in my computer (for example D:\\th.jpg ) into a MS SQL Server binary column with T-SQL and choose specific row with WHERE clause.

This column's name is Image with a datatype of varbinary(MAX) and my table name is Recipes .

Update dbo.Recipes
Set Image = (SELECT * FROM OPENROWSET(BULK N'D:\th.jpg', SINGLE_BLOB) Image)
Where Id = 13

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM