how to create a function in SQL server to translate dates in 3 languages? [closed]

0

How can I create a function that receives 2 parameters a datetime and another the language. translate for example: Sunday 12 August 2018 English thursday 12 August 2018

    
asked by Angélica Garcia Pedraza 13.08.2018 в 06:20
source

1 answer

0

You can use "SET LANGUAGE".

Within your function you could have a condition asking for your second parameter, I give you a clue.

DECLARE @Today DATETIME;  
SET @Today = '12/5/2007';  

SET LANGUAGE Italian;  
SELECT DATENAME(month, @Today) AS 'Month Name';  

SET LANGUAGE us_english;  
SELECT DATENAME(month, @Today) AS 'Month Name' ;  
GO 

Try and tell me.

    
answered by 13.08.2018 / 21:53
source