SET DATEFIRST %1! is out of range.

Error Message:
Msg 2742, Level 16, State 1, Line 1
SET DATEFIRST %1! is out of range.

Severity level:
16.

Description:
This error message appears when an invalid date format was specified.

Consequences:
The SQL statement can be parsed, but cannot be executed and execution is stopped.

Resolution:
Error of the severity level 16 are generated by the user and can be fixed by the SQL Server user. In this case the parameter for DATEFIRST must be in the valid range of 1 – 7.

Versions:
All versions of SQL Server.

Example(s):
SET DATEFIRST 0

Remarks:
By using SET DATEFIRST you can tell SQL Server which day to use as the first day of a week. 7 (=Sunday) is default.

]]>

Leave a comment

Your email address will not be published.