Show TOC

ALLOW_NULLS_BY_DEFAULT Option [TSQL]Locate this document in the navigation structure

Controls whether new columns created without specifying either NULL or NOT NULL are allowed to contain NULL values.

Allowed values

ON, OFF

Default

ON

OFF for Open Client and JDBC connections

Scope

Option can be set at the database (PUBLIC) or user level. At the database level, the value becomes the default for any new user, but has no impact on existing users. At the user level, overrides the PUBLIC value for that user only. No system privilege is required to set option for self. System privilege is required to set at database level or at user level for any user other than self.

Requires the SET ANY PUBLIC OPTION system privilege to set this option. Can be set temporary for an individual connection or for the PUBLIC role. Takes effect immediately.

Remarks

The ALLOW_NULLS_BY_DEFAULT option is included for Transact-SQL compatibility.