Hi,
I'd like to know if there is a way of using a stored procedure to write the result of a query to a csv file.
My application code will create the csv file if it does not exist and i am assuming that suitable permissions will be available on the file for sql server.
What I would like to do is this:
If the file is empty, insert the columns returned in the query followed by the rows of the query result.
On subsequent calls to the stored procedure, simply append the result of the query to the csv file.
Thanks,
MrPeds
I'd like to know if there is a way of using a stored procedure to write the result of a query to a csv file.
My application code will create the csv file if it does not exist and i am assuming that suitable permissions will be available on the file for sql server.
What I would like to do is this:
If the file is empty, insert the columns returned in the query followed by the rows of the query result.
On subsequent calls to the stored procedure, simply append the result of the query to the csv file.
Thanks,
MrPeds