title: Script to save varbinary data to disk
body: <p>I have some varbinary data stored in a table in MS Sql Server 2005.  Does anyone have SQL code that takes a query as input (lets say the query guarantees that a single column of varbinary is returned) and outputs the bytes to disk (one file per row?)  I'm sure this has been asked a thousand times before, but Googling comes up with mostly .net solutions.  I want an SQL solution.</p>