Category Archives: SQL

MS SQL How To Store a File into a blob field

If you need to store a file from your hard drive into a filed in MS Sql Server, you can run this code

UPDATE dbo.[Table] SET [Field]= (SELECT * FROM OPENROWSET(BULK N’C:fileName.PNG’,SINGLE_BLOB) rs)