Поделиться через


BindRule Method

В будущей версии Microsoft SQL Server эта возможность будет удалена. Избегайте использования этой возможности в новых разработках и запланируйте изменение существующих приложений, в которых она применяется.

The BindRule method implements Microsoft SQL Server rule binding and unbinding for columns and user-defined data types.

Синтаксис

object.BindRule(RuleOwner,RuleName,Bind [,bFutureOnly])

Parts

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

  • RuleOwner
    String identifying the database user owning the bound rule.

  • RuleName
    String identifying the bound rule by name.

  • Bind
    TRUE or FALSE as described in Settings.

  • bFutureOnly
    TRUE or FALSE. This is an optional parameter that applies only to the UserDefinedDatatype object.

Prototype (C/C++)

HRESULT BindRule(SQLDMO_LPCSTR RuleOwner,
SQLDMO_LPCSTR RuleName, BOOL Bind, BOOL bFutureOnly);

Settings

When Bind is TRUE, the rule named is bound to the column or user-defined data type referenced.

When Bind is FALSE, any rule is unbound from the referenced column or user-defined data type. The RuleOwner and RuleName properties are ignored.

ПримечаниеПримечание

When you use the UserDefinedDatatype object, the bFutureOnly parameter is available in C/C++ applications.

Замечания

The BindRule method of the Column or UserDefinedDatatype objects, and the BindToColumn and BindToDatatype methods of the Rule object, associate a SQL Server rule with a user-defined data type or column.

The BindDefault method does not cause a check of existing values when a new rule is indicated for a column or user-defined data type.