SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sending emails to customers in their language


Sending emails to customers in their language

Author
Message
OlyKLin
OlyKLin
Mr or Mrs. 500
Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)

Group: General Forum Members
Points: 581 Visits: 138
Hi Everyone

I was wondering if it's possible to send emails to customers in their native language?
Our Server/DB is in us_english but we have customers in Spain, Portugel, UK, India etc and we'd like to send them emails in their language.

Is it possible to do this? I've tried SET LANGUAGE but it doesn't seem to work for text. It works for Dates.

Thanks!

Cathryn
John Mitchell-245523
John Mitchell-245523
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86494 Visits: 18163
Cathryn

What doesn't work about SET LANGUAGE, and why do you even need it? Can you not just put the messages in the various languages in a table and select from there for your e-mail?

'Hindi', 'नमस्ते'
'English', 'Hello'
'Spanish', 'Buenos días'
'Portuguese', 'Bom dia'


John
OlyKLin
OlyKLin
Mr or Mrs. 500
Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)Mr or Mrs. 500 (581 reputation)

Group: General Forum Members
Points: 581 Visits: 138
Hi John

This is what I tried:

DECLARE @TEXT varchar(50)
SELECT @TEXT = 'HELLO'

SET LANGUAGE 'Spanish'
SELECT @TEXT

It just gives me back 'HELLO'.

I thought about storing the messages in a text and just pulling them but I was hoping I might be able to do it on the fly
ZZartin
ZZartin
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14100 Visits: 14637
That is simply not what set language does, all it's doing is saying you want some specific localization like date names/formats etc... It's not going to take some random text, see that it's in english and then convert to the language you want. Based on your example how would you ever be able to actually get 'HELLO' back after setting the language to spanish BigGrin
Sue_H
Sue_H
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: General Forum Members
Points: 36324 Visits: 10377
OlyKLin - Monday, February 5, 2018 11:44 AM
Hi John

This is what I tried:

DECLARE @TEXT varchar(50)
SELECT @TEXT = 'HELLO'

SET LANGUAGE 'Spanish'
SELECT @TEXT

It just gives me back 'HELLO'.

I thought about storing the messages in a text and just pulling them but I was hoping I might be able to do it on the fly


SET LANGUAGE works on system messages and data formats but won't translate other text. With system messages, it gets the alternative language value from sys.messages. Storing that text may be something you want to do, similar to sys.messages, but it depends on how much text it involves.

Sue



Subramaniam Chandrasekar
Subramaniam Chandrasekar
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1032 Visits: 388
OlyKLin - Monday, February 5, 2018 9:30 AM
Hi Everyone

I was wondering if it's possible to send emails to customers in their native language?
Our Server/DB is in us_english but we have customers in Spain, Portugel, UK, India etc and we'd like to send them emails in their language.

Is it possible to do this? I've tried SET LANGUAGE but it doesn't seem to work for text. It works for Dates.

Thanks!

Cathryn

You do require an user defined function for this ? If I'm not wrong, while working with different time zones, We'll create an user defined functions and

convert the date time to user's timezone date time. We'd need to follow the same here.SmileSmile

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search