Sometimes the creativity of the human species is truly amazing. Someone needed to export a table into a file from within SQL Server. Now there are several ways to do this like bcp, export wizard, Query..Results To File, SSIS etc etc. Today I noticed someone found yet another way….

This person decided to use a SQL Agent job to create the file. That is still not strange but here comes the interesting part…

Here is what the person did, first a job was added with a query.

Then in the Advanced part of the step an output file was chosen

This of course will create the file, however there will be some output in the from the job itself

The only reason I found out about this was because I was asked how to skip the ‘header’ in SQL Server. After a good deal of puzzlement looking at this creative ‘solution’ I told the person how to use bcp instead

Any crazy stories from the trenches you want to share in the comments?