Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Table.AnsiNullsStatus Property

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)

public bool AnsiNullsStatus { get; set; }

Property Value

Type: 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).



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.

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


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

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


$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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft