次の方法で共有


AnsiNulls Property

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The AnsiNulls property reports the NULL acceptance behavior for new columns.

構文

object
.AnsiNulls [=value]

Parts

  • object
    An expression that evaluates to an object in the Applies To list
  • value
    TRUE or FALSE

Data Type

Boolean

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetAnsiNulls(LPBOOL pRetVal);
HRESULT SetAnsiNulls(BOOL NewValue);

解説

By default, Microsoft SQL Server creates columns that do not accept NULL when the user does not explicitly declare the ability to accept NULL. Further, SQL Server returns TRUE when evaluating the expression NULL = NULL. These default behaviors are nonstandard.

If AnsiNulls is TRUE, new columns accept NULL by default and any comparison of NULL to any other value, including NULL, returns NULL.

The AnsiNulls property affects the way in which NULLs are handled for the user's connection only and overrides any database-specific settings for column creation and NULL comparison.

Applies To:

SQLServer Object