How to get a CSV file from a T-SQL in SQL Agent

LUIXANY COLISEE 0 Reputation points
2024-09-26T13:24:49.4666667+00:00

I am using SQL agent to schedule a task. This task is the execution of a script that performs a query to several databases and concatenates the output. I have managed to obtain a file but not a CSV file, that is, I cannot obtain a file separating the fields by commas or periods, it is rather a txt file with columns. How can I achieve this? In the options configuration I do not see the option to define these output parameters in the files that result from a T-SQL

Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,637 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.