Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Need a task that outputs a CSV text file of a couple of tables about every 5 minutes.
Server is MSSQL 2008. It is a production server.

requirements are:
* utf8 output
* '\t' or ';' cell separator
* '\n' row terminator
* file should be overwritten * the output is a join of two tables (dbo.article and dbo.stock key being 'c_art')

share|improve this question

1 Answer 1

There's so little information in the question that I'm not entirely sure of your requirements, but you can use BCP in a scheduled task or as a stored procedure to accomplish this.

Command format:

BCP <table> out <filename> <switches>

The switches used here are:

    * -c Output in ASCII with the default field terminator (tab) and row terminator (crlf)
    * -t override the field terminator with ","
    * -T use a trusted connection. Note that U –P may be used for username/password
    * -S connect to this server to execute the command
share|improve this answer
added requirements, thanks –  medecau Jan 29 '10 at 9:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.