CheckDefaultSyntax Method
Diese Funktion wird in zukünftigen Versionen von Microsoft SQL Server nicht mehr bereitgestellt. Verwenden Sie diese Funktion beim Entwickeln neuer Anwendungen nicht, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird.
The CheckDefaultSyntax method allows an application to validate the syntax of a Transact-SQL database default prior to creating it.
Syntax
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);
Hinweise
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:
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 or CheckRuleSyntax to verify the syntax of the Text property.
Drops the existing object and recreates it using the new object if CheckDefaultSyntax or CheckRuleSyntax returns TRUE.
CheckDefaultSyntax returns TRUE if the Transact-SQL syntax is valid.