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
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
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.