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 on开发者_运维问答e text file only that would be even better.
I think you may want to use
- SSIS and send the output to a file in CSV format
- BCP
- SQLCMD
精彩评论