Quarksoft Blog

This is where we post useful information for everyone. Lots of it is technical, but some can be used by anyone.

Creating Insert Statements for SQL Server

<< Using and Managing SQL Server Aliases  T-SQL >>

Ran across an interesting approach to generating insert statements for SQL Server 2005 (and other variants).  If uses a less well known function called master.dbo.fn_varbintohexstr. The approach that was taken was to use the fn_varbintohexstr function to encode the data so you did not need to use cursors or any fancy parsing to handle unicode and quotes in the generated insert statements.  I thought it was a bit clever.

Note: you might need to register at SQLServerCentral.com to gain access to the site to read the above linked article.

Leave a Reply