Is there a build-in function in SQL Server which return my polish (or any other language) name of month by month number? Or need I write my own function?
For example
GetMonthName(11) => Listopad (November)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the function Month or datepart “month” to return a month number from date/time. Then you can use the DATENAME function:
The return value depends on the language environment set by using SET LANGUAGE and by the “configure the default language” server configuration option for the login.
So as per Jacek’s comment, this can be summarised as:
If literally all you have is a month number, you would need to build a datetime variable that incorporates this month number so that you can apply the above approach. In SQL Server 2012, you can use DATETIMEFROMPARTS: