I use sp_send_dbmail in SQL2005 to send emails with the results in the application. When the application is sent, it is encoded by UCS-2, I want it to be ANSI or UTF-8.
Here is SQL
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'temp@example.com'
, @query = 'DECLARE @string_to_trim varchar(60);SET @string_to_trim = ''1234''; select rtrim(@string_to_trim), ''tom'''
, @query_result_header=0
, @subject = 'see attach'
, @body= 'temp body'
, @profile_name= N'wksql01tAdmin'
, @body_format = 'HTML'
,@query_result_separator = ','
,@query_attachment_filename = 'results.csv'
,@query_no_truncate = '0'
,@attach_query_result_as_file = 1
I saw some comments on the Internet that this is fixed with sql2005 SP2, but do not discover that it is.
chris
source
share