Inserting Binary Data in SQL Server Management Studio

by William March 10, 2010 2:55 PM

Found this useful little SQL script for SQL Server that allows you to insert binary data from a file inside SQL Server Management Studio (not something I need to do very often, but when I do need to do it this can be very useful indeed:)

UPDATE FileType
SET Icon =
  (SELECT * 
   FROM OPENROWSET (BULK N'c:\Upload\Quicktime-icon.png', SINGLE_BLOB) AS [image])
WHERE Extension = '.mov'

Thought I'd post this here so I don't forget it!

Tags: ,

SQL Server

Who is William?

William Jerla
MCTS
William Jerla is the Director of Application Development at DiscoverTec, a Web Design and IT Services firm located in Jacksonville, Florida.
William is a Microsoft Certified Technology Specialist in ASP.Net 3.5 Web Applications.

Recent Posts