How to insert binary data into sql server using SSMS

Found the answer:

SQL Server has an “OPENROWSET” command that accepts a filepath.

eg

Update myTable
set Image = (
SELECT *
FROM OPENROWSET(BULK N'C:\image.png', SINGLE_BLOB) test)
where ImageID = 1 

Source: http://shortfastcode.blogspot.com/2009/12/insert-binary-data-like-images-into-sql.html

Leave a Comment

techhipbettruvabetnorabahisbahis forumu