CheckRuleSyntax Method
Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.
The CheckRuleSyntax method validates the syntax of a Transact-SQL database rule prior to creating it.
구문
object
.CheckRuleSyntax(
Rule
)
Parts
- object
Expression that evaluates to an object in the Applies To list.
- Rule
A Rule object.
Prototype (C/C++)
HRESULT CheckRuleSyntax(LPSQLDMORULE Rule);
주의
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 method or CheckRuleSyntax method 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:
- Creates a new rule or default object.
- Sets the Name property of the new object to the name of the existing object.
- Sets the Text property of the new object to define the default or rule.
- Calls CheckDefaultSyntax method or CheckRuleSyntax method to verify the syntax of the Text Property.
- Drops the existing object and recreates it using the new object if CheckDefaultSyntax method or CheckRuleSyntax method returns TRUE.
- CheckDefaultSyntax method returns TRUE if the Transact-SQL syntax is valid.