We do not have it in Database mail today.
There were some posting related to this and we have tracking bug for this issue.
Please use the below link and vote on the existing bug.
http://lab.msdn.microsoft.com/productfeedback/
Thanks,
Gops Dwarak
twoot22 wrote:
In sqlmail, it uses "@ansi_attachment=true" to set up your attachment as ansi format. is there any way to do the same in sql server 2005
I realize that way not be the answer you (or I) want, but apparently this is only fixed in SP 2 (which went CTP on 2006/11/06 - i.e 4 days ago at time of posting). I got this from the following:
http://www.sqlservercentral.com/forums/shwmessage.aspx forumid=146&messageid=279118
This has indeed been fixed in SP2. The failure was in creating a unicode .csv file without the initial BOM mark. That has been remedied, and your .csv files will open without incident.
You can evaluate this, and many other fixes, by downloading SP2 CTP2.
jkh
James,
Thank you for the update on this. We can't institute our large-scale notification system until this fix becomes live. I assume you can't comment on the estimated time of release of the actual service pack, as we are currently unwilling to install the CTP2 on production systems.
Thanks again.
-Dan
This is a problem for me as well as I am passing data via email from SQL Server through a satelite gateway to a microcontroller. Satelite communications are relatively expensive and every byte counts. I don't need to use unicode for my data. I need to be able to use sp_send_dbmail with a query and query results sent as an attachment. The attachment is a requirement of the satelite provider. I have SP2 installed and I don't see any parameters to the sp_send_dbmail stored procedure which control the character set used for the query results attachment file. I tried @ansi_attachment = 1 and it fail with an error message stating that the parameter is invalid.
Does anyone lnow how to do this
I have installed SP2 for SQL server 2005 but still have the problem with ansi file attachments.
I not only have .csv but also .txt that are load in to other systems and need to be ansi.
Is there any other way to do this.
Cheers Roger
Does anyone know if there is a work around for this yet
I have installed Sp2 and there isn't a fix for it in there and this issue is starting to become a pain in the bottom. I have read somewhere that SQL 7.0 had this feature and originally SQL 2000 didn't, but it was added later on. If this is true, can MS please add it to SQL 2005
Thank you!
The only workaround that I could come up with was to use BCP with my query to generate the ANSI text file in a temp folder on the server. Then I sent the resulting file as an attachment with sp_send_dbmail as normal. You can use timestamps to ensure a unique filename and then just delete the file when done with xp_cmdshell. Not pretty but it works.