Table.AnsiNullsStatus Property

 

Applies To: SQL Server 2016 Preview

Gets the Boolean property value that specifies whether ISO NULL handling is enabled on the table.

Namespace:   Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

[SfcPropertyAttribute(SfcPropertyFlags.None | SfcPropertyFlags.ReadOnlyAfterCreation | SfcPropertyFlags.Standalone | SfcPropertyFlags.SqlAzureDatabase | SfcPropertyFlags.Design | SfcPropertyFlags.Matrix)]
public bool AnsiNullsStatus { get; set; }
public:
[SfcPropertyAttribute(SfcPropertyFlags::None | SfcPropertyFlags::ReadOnlyAfterCreation | SfcPropertyFlags::Standalone | SfcPropertyFlags::SqlAzureDatabase | SfcPropertyFlags::Design | SfcPropertyFlags::Matrix)]
property bool AnsiNullsStatus {
    virtual bool get() sealed;
    virtual void set(bool value) sealed;
}
[<SfcPropertyAttribute(SfcPropertyFlags.None | SfcPropertyFlags.ReadOnlyAfterCreation | SfcPropertyFlags.Standalone | SfcPropertyFlags.SqlAzureDatabase | SfcPropertyFlags.Design | SfcPropertyFlags.Matrix)>]
abstract AnsiNullsStatus : bool with get, set
[<SfcPropertyAttribute(SfcPropertyFlags.None | SfcPropertyFlags.ReadOnlyAfterCreation | SfcPropertyFlags.Standalone | SfcPropertyFlags.SqlAzureDatabase | SfcPropertyFlags.Design | SfcPropertyFlags.Matrix)>]
override AnsiNullsStatus : bool with get, set
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.ReadOnlyAfterCreation Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase Or SfcPropertyFlags.Design Or SfcPropertyFlags.Matrix)>
Public Property AnsiNullsStatus As Boolean

Property Value

Type: System.Boolean

A Boolean value that specifies the whether the ISO NULL handing is enabled or not.

If True, comparisons to null values equate to False. Otherwise, False (default).

Implements

ITableOptions.AnsiNullsStatus

Remarks

This property specifies whether any comparison to a null value equates to a NULL value. For, a SELECT statement that uses WHERE column_name <> NULL returns zero rows even if there are non-null values in column_name.

Examples

Legacy Code Example

The following code example shows how to declare a new table on the specified database, with the specified name.

C#

Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];

Table tb = new Table(db, "Test Table");
tb.AnsiNullsStatus = true;

Powershell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2012")

#Define the Table
$tb = new-object Microsoft.SqlServer.Management.Smo.Table($db, "Test Table")
$tb.AnsiNullsStatus = $TRUE

See Also

Table Class
Microsoft.SqlServer.Management.Smo Namespace

CREATE TABLE (Transact-SQL)
Unable to find linked topic '811e00f9-303f-42b5-8bd4-2cdb829c84e9'.

Return to top