vbNewbie
vbNewbie

Reputation: 3345

job results to a txt file in sql server

I have set up a job within SSMS to run everyday where it executes queries against two tables and stores the results in .csv text files in a folder. It works fine but I would like the files to be comma delimited text files and it is storing it with spaces between the columns and this creates unnecessary increase in size.. I went to tool/options etc and set the sql query text file format to comma delimited and it works fine when I run a manual query and select to save the results but not within the actual job. Any suggestions

In fact if I could get the results from bot queries to store into one text file only that would be even better.

Upvotes: 0

Views: 1137

Answers (1)

Sankar Reddy
Sankar Reddy

Reputation: 1499

I think you may want to use

  1. SSIS and send the output to a file in CSV format
  2. BCP
  3. SQLCMD

Upvotes: 1

Related Questions