Manually inserting varbinary data into SQL Server

Posted by Jeremy Jarrell on Stack Overflow See other posts from Stack Overflow or by Jeremy Jarrell
Published on 2009-06-29T14:28:43Z Indexed on 2010/05/12 9:04 UTC
Read the original article Hit count: 378

Filed under:
|

Hi,

We have a SQL Server table for user settings. Originally the settings were domain objects which had been serialized as XML into the table but we recently begun serializing them as binary.

However, as part of our deployment process we statically pre-populate the table with predefined settings for our users. Originally, this was as simple as copying the XML from a customized database and pasting it into an INSERT statement that was ran after the database was built. However, since we've moved to storing the settings as binary data we can't get this to work.

How can we extract binary data from a varbinary column in SQL Server and paste it into a static INSERT script? We only want to use SQL for this, we don't want to use any utilities.

Thanks in advance, Jeremy

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server