Dropping defaults  create rule syntax

Chapter 13: Defining Defaults and Rules for Data

Creating rules

A rule lets you specify what users can or cannot enter into a particular column or any column with a user-defined datatype. In general, to create a rule you:

  1. Create the rule using create rule.

  2. Bind the rule to a column or user-defined datatype using sp_bindrule.

  3. Test the bound rule by inserting data. Many errors in creating and binding rules can be caught only by testing with an insert or update command.

You can unbind a rule from the column or datatype either by using sp_unbindrule or by binding a new rule to the column or datatype.





Copyright © 2005. Sybase Inc. All rights reserved. create rule syntax

View this book as PDF