title: Ad-hoc retreival of data from SQL Server varbinary column
body: <p>I would like to retreive some binary data from a <code>varbinary(max)</code> column in a SQL Server database for debugging purposes.</p>
  
  <p>What is the easiest way to get this data into a local binary file, preferably without having to write a throw-away console application?</p>
  
  <p>I have tried using SQL Server Management Studio (with the "results to file" option) but this outputs a hex encoded binary string to the file, rather than the raw binary data.</p>