Set First Day of the Week in SQL Server

Hello to everyone,

In this article, I will give you information about how to assign the first day of the week information in SQL Server.

You may want to change the first day of the week in SQL Server.

The DATEFIRST statement sets the first day of the week for the session to a number from 1 through 7.

In SQL Server the values for the days of the week are the following:

1 – Monday
2 – Tuesday
3 – Wednesday
4 – Thursday
5 – Friday
6 – Saturday
7 – Sunday

For example, for us_english language setting your session’s DATEFIRST setting has a default value 7 (it means that Sunday is the first day of the week), and for German it is 1 (Monday is the first day of the week)

You can also do this using the code below.

SET LANGUAGE us_english;
SELECT @@DATEFIRST;

SET LANGUAGE German;
SELECT @@DATEFIRST;

When you run the code you will get the following result.

Set First Day of the Week in SQL Server

Good luck to everyone in business and life.

274 Views

Yavuz Selim Kart

I try to explain what I know in software and database. I am still improving myself by doing research on many programming languages. Apart from these, I am also interested in Graphic Design and Wordpress. I also have knowledge about SEO and Social media management. In short, I am a determined person who likes to work hard.

You may also like...

Don`t copy text!