If your database serves users in different regions, controlling how month names appear is one of those small but important details. Maybe you’re generating reports for users across regions, or exporting data that needs to match a specific locale. Whatever the case, sometimes you just need SQL Server to show month names in a different language.
This article walks through how SQL Server handles month names under different language and locale settings, and how you can control that behavior.
Where Month Names Come From
By default, SQL Server uses the language setting of your session (or login) to determine the language for date-related text such as month and day names. For example, when you use functions like DATENAME() or FORMAT(), the language determines whether you get “January” or “Enero”.
There are two main ways to influence this behavior:
- Changing the session language using
SET LANGUAGE - Using a specific culture code with the
FORMAT()function
The first one (SET LANGUAGE) changes the session’s default language for date names, while the other one ignores that setting and uses the culture you specify instead.
Example 1: Using SET LANGUAGE
This method changes the current session’s language context. It affects functions such as DATENAME() that rely on SQL Server’s internal language tables.
Here’s a simple setup you can run directly:
-- Drop table if it already exists
DROP TABLE IF EXISTS dbo.MonthTest;
-- Create test table
CREATE TABLE dbo.MonthTest
(
Id INT IDENTITY(1,1) PRIMARY KEY,
SampleDate DATE
);
-- Insert some dates
INSERT INTO dbo.MonthTest (SampleDate)
VALUES ('2025-01-15'), ('2025-03-10'), ('2025-07-20'), ('2025-12-05');
Now, let’s see how SET LANGUAGE changes the output:
-- English month names
SET LANGUAGE English;
SELECT
Id,
SampleDate,
DATENAME(MONTH, SampleDate) AS MonthName_English
FROM dbo.MonthTest;
Result:
Changed language setting to us_english.
Id SampleDate MonthName_English
----------- ---------------- ------------------------------
1 2025-01-15 January
2 2025-03-10 March
3 2025-07-20 July
4 2025-12-05 December
The month names were output in English because our current SET LANGUAGE setting was set to English. Actually, this is an alias for us_english, so either one would produce the same result. We’d also get the same result if we’d used British.
Now let’s switch to a different language:
-- Switch to Spanish
SET LANGUAGE Spanish;
SELECT
Id,
SampleDate,
DATENAME(MONTH, SampleDate) AS MonthName_Spanish
FROM dbo.MonthTest;
Output:
Se cambió la configuración de idioma a Español.
Id SampleDate MonthName_Spanish
----------- ---------------- ------------------------------
1 2025-01-15 Enero
2 2025-03-10 Marzo
3 2025-07-20 Julio
4 2025-12-05 Diciembre
This time the month names were output in Spanish, due to our new SET LANGUAGE setting.
Let’s try one more:
-- And then to French
SET LANGUAGE French;
SELECT
Id,
SampleDate,
DATENAME(MONTH, SampleDate) AS MonthName_French
FROM dbo.MonthTest;
Output:
Le paramètre de langue est passé à Français.
Id SampleDate MonthName_French
----------- ---------------- ------------------------------
1 2025-01-15 janvier
2 2025-03-10 mars
3 2025-07-20 juillet
4 2025-12-05 décembre
SET LANGUAGE is simple and works well for ad-hoc queries or reports where you only need one language at a time. One downside is that it changes the entire session’s language setting, which can have side effects in multi-user or shared environments.
Example 2: Using FORMAT() with Culture Codes
If you need multiple languages in the same query or want to avoid changing session settings, the FORMAT() function is your best option. It lets you specify a culture directly, using standard .NET culture codes such as en-US, es-ES, or fr-FR:
SELECT
Id,
SampleDate,
FORMAT(SampleDate, 'MMMM', 'en-US') AS Month_English,
FORMAT(SampleDate, 'MMMM', 'es-ES') AS Month_Spanish,
FORMAT(SampleDate, 'MMMM', 'fr-FR') AS Month_French
FROM dbo.MonthTest;
Result:
Id SampleDate Month_English Month_Spanish Month_French
----------- ---------------- ----------------- ------------------ -----------------
1 2025-01-15 January enero janvier
2 2025-03-10 March marzo mars
3 2025-07-20 July julio juillet
4 2025-12-05 December diciembre décembre
This gives you all three languages side by side – no SET LANGUAGE needed.
The FORMAT() function uses .NET’s culture settings, which makes it extremely flexible for localization tasks.
One downside of this option is that it’s slower than DATENAME() on large datasets because it runs through .NET’s formatting layer. However, this option is perfect for multilingual reports or exports where you need consistent output in multiple languages.