Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
IK1972
56 Posts |
Posted - 2015-02-04 : 18:34:55
|
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 |
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2015-02-04 : 19:30:25
|
Have you tried putting double quotes around your column that holds the SQL statement? Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. -Lord Byron, poet (1788-1824) |
|
|
IK1972
56 Posts |
Posted - 2015-02-04 : 20:49:52
|
Yes I try but its not workingquote: Originally posted by Bustaz Kool Have you tried putting double quotes around your column that holds the SQL statement? Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. -Lord Byron, poet (1788-1824)
|
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-02-05 : 09:07:13
|
YOu need to post your code that calls sp_send_dbmail and any error messages you receive |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2015-02-05 : 12:09:52
|
Have you tried HTML format instead of CSV?Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|
|
|