I have one table called stats where we collect the stats and top queries. I need to send report on regular basis for top queries.
I'm trying to send email with sp_send_dbmail with CSV file attached. Issue is in result set i have 8 columns and one column is with SQL Statement so it has comma and carriage returns so when I open the csv file its not display data properly.
Any idea how to fix this issue.
Thanks