Learn T-SQL Commands with Samples
Skip Navigation Links
Skip Navigation Links.
Expand DatabaseDatabase
Expand TableTable
Expand ViewView
Expand Stored ProcedureStored Procedure
Expand Data FilteringData Filtering
Expand Data GroupingData Grouping
Expand JoinsJoins
Expand TriggerTrigger
Expand CursorCursor
Expand OperatorsOperators
Expand ConstraintsConstraints
Expand FunctionsFunctions
Expand Conditional ProcessingConditional Processing
Expand LoopingLooping
Expand Error HandlingError Handling
Expand v.IMP Queriesv.IMP Queries
Expand XMLXML
Expand Query PerformanceQuery Performance
Expand QueriesQueries
Expand NormalizationNormalization
Collapse CreateCreate
     

Rule

 
      
---- Define the rule for use in the database
CREATE RULE dbo.positive_value22 AS @value >= 0 GO
---- Bind the rule to a specific column in a table
EXEC sp_bindrule 'dbo.positive_value', 'myTable.myColumn' GO
---- to Unbind the rule from the column
EXEC sp_unbindrule 'myTable.myColumn' GO