次の方法で共有


CheckDefaultSyntax Method

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

The CheckDefaultSyntax method allows an application to validate the syntax of a Transact-SQL database default prior to creating it.

構文

object
.CheckDefaultSyntax(
Default
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Default
    A Default object

Prototype (C/C++)

HRESULT CheckDefaultSyntax(LPSQLDMODEFAULT Default);

解説

Database defaults and rules cannot be modified once they are created. They must first be dropped and then recreated. An application can call the CheckDefaultSyntax or CheckRuleSyntax method to validate the syntax of a Transact-SQL database rule prior to its creation.

An application might call the CheckDefaultSyntax or CheckRuleSyntax in a scenario in which a rule or default already exists, and it is necessary to change the definition (specified by the Text property). The application:

  1. Creates a new rule or default object.
  2. Sets the Name property of the new object to the name of the existing object.
  3. Sets the Text property of the new object to define the default or rule.
  4. Calls CheckDefaultSyntax or CheckRuleSyntax to verify the syntax of the Text property.
  5. Drops the existing object and recreates it using the new object if CheckDefaultSyntax or CheckRuleSyntax returns TRUE.
  6. CheckDefaultSyntax returns TRUE if the Transact-SQL syntax is valid.

Applies to:

Database2 Object

参照

関連項目

CheckRuleSyntax Method

ヘルプおよび情報

SQL Server 2005 の参考資料の入手