title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | ||
---|---|---|---|---|---|---|---|---|---|---|
Server configuration: two digit year cutoff |
Get acquainted with the two digit year cutoff option. Understand how it determines how SQL Server translates two-digit years into four-digit years. |
rwestMSFT |
randolphwest |
10/18/2024 |
sql |
configuration |
conceptual |
|
[!INCLUDE SQL Server]
This article describes how to configure the two digit year cutoff
server configuration option in [!INCLUDE ssnoversion] by using [!INCLUDE ssManStudioFull] or [!INCLUDE tsql]. The two digit year cutoff
option specifies an integer from 1753 to 9999 that represents the cutoff year for interpreting two-digit years as four-digit years. The default time span for [!INCLUDE ssNoVersion] is 1950-2049, which represents a cutoff year of 2049. This means that [!INCLUDE ssNoVersion] interprets a two-digit year of 49 as 2049, a two-digit year of 50 as 1950, and a two-digit year of 99 as 1999. To maintain backward compatibility, leave the setting at the default value.
This option is an advanced option and should be changed only by an experienced database administrator or certified [!INCLUDE ssNoVersion] professional.
OLE Automation objects use 2030 as the two-digit cutoff year. You can use the two digit year cutoff
option to provide consistency in date values between [!INCLUDE ssNoVersion] and client applications.
To avoid ambiguity with dates, always use four-digit years in your data.
Execute permissions on sp_configure
with no parameters or with only the first parameter are granted to all users by default. To execute sp_configure
with both parameters to change a configuration option or to run the RECONFIGURE
statement, a user must be granted the ALTER SETTINGS
server-level permission. The ALTER SETTINGS
permission is implicitly held by the sysadmin and serveradmin fixed server roles.
-
In Object Explorer, right-click a server and select Properties.
-
Select the Misc server settings node.
-
Under Two digit year support, in the When a two digit year is entered, interpret it as a year between box, type or select a value that is the ending year of the time span.
-
Connect to the [!INCLUDE ssDE].
-
From the Standard bar, select New Query.
-
Copy and paste the following example into the query window and select Execute. This example shows how to use sp_configure to set the value of the
two digit year cutoff
option to2030
.USE master; GO EXECUTE sp_configure 'show advanced options', 1; GO RECONFIGURE; GO EXECUTE sp_configure 'two digit year cutoff', 2030; GO RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; GO RECONFIGURE; GO
For more information, see Server configuration options.
The setting takes effect immediately without restarting the server.