Monday, 12 July 2010

Scripting Data to a .CSV format

A simple way to script example data, so it can be posted in forums etc...

SELECT  'SELECT '
      + QUOTENAME(column1,'''')+','
      + QUOTENAME(column2,'''')+','
      + QUOTENAME(column3,'''')
      + ' UNION ALL'
 FROM myschema.mytable

SSC : How to post data/code on a forum

No comments: