Display Simplified Chinese char in SQL Email alert

Posted on 2014-08-26
Last Modified: 2014-08-27
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 = ''
     ,@subject = 'Email alert '
     ,@body = @s5
Question by:AXISHK
    LVL 24

    Expert Comment

    Is your @s5 variable defined as nvarchar()?

    Author Comment

    declare @s5 varchar(2000)

    Should i change the text format (,@body_format='TEXT') ?
    LVL 24

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now