http://blog.sqlauthority.com/2007/04/22/sql-server-datefirst-and-set-datefirst-relations-and-usage/
This will set Friday as first day of week.
@@DATEFIRST returns the current value, for the session, of SET DATEFIRST.
In this way @@DATEFIRST and SET DATEFIRST are related.
The master database’s syslanguages table has a DateFirst column that defines the first day of the week for a particular language. SQL Server with US English as default language, SQL Server sets DATEFIRST to 7 (Sunday) by default. We can reset any day as first day of the week using
SET DATEFIRST 5
This will set Friday as first day of week.
@@DATEFIRST returns the current value, for the session, of SET DATEFIRST.
SET LANGUAGE italian
GOSELECT @@DATEFIRSTGO----This will return result as 1(Monday)SET LANGUAGE us_english
GOSELECT @@DATEFIRSTGO----This will return result as 7(Sunday)
In this way @@DATEFIRST and SET DATEFIRST are related.
No comments:
Post a Comment