GETANSINULL (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

Returns the default nullability for the database for this session.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
GETANSINULL ( [ 'database' ] )  

Arguments

database
Is the name of the database for which to return nullability information. databaseis either char or nchar. If char, database is implicitly converted to nchar.

Return Types

int

Remarks

When the nullability of the specified database allows for null values and the column or data type nullability is not explicitly defined, GETANSINULL returns 1. This is the ANSI NULL default.

To enable the ANSI NULL default behavior, one of these conditions must be set:

Examples

The following example returns the default nullability for the AdventureWorks2012 database.

USE AdventureWorks2012;  
GO  
SELECT GETANSINULL('AdventureWorks2012')  
GO  

Here is the result set.

------  
1  

(1 row(s) affected)

See Also

System Functions (Transact-SQL)