Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Display Simplified Chinese char in SQL Email alert

The field "s5" contains simplified chinese chars that can't be displayed in a email content under SQL 2008R2. Is there a way to fix it ?

exec msdb..sp_send_dbmail @profile_name =  'DiskLog_profile'      
     ,@recipients = 'adm@abc.com'
     ,@subject = 'Email alert '
     ,@body = @s5
     ,@body_format='TEXT'
end
0
AXISHK
Asked:
AXISHK
  • 2
1 Solution
 
chaauCommented:
Is your @s5 variable defined as nvarchar()?
0
 
AXISHKAuthor Commented:
declare @s5 varchar(2000)

Should i change the text format (,@body_format='TEXT') ?
0
 
chaauCommented:
declare it as nvarchar(2000).
Also, when you assign the values as literals, add N before apostrophes:
declare @s5 varchar(2000)
SET @s5 = N'你好。'

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now