Check Constraint:
Check constraint is associated with columns in a Table. So these can't be re-used.
Suppose if "Emp" table having the coulmn "Salary" then
alter table Emp add constraint ck_op Check (Salary between 15000 and 45000)
Rule:
Rules are defined with in a database and can be applied to any number of columns.
Creating Rule:
CREATE RULE SAL_RANGE
as
@Sal > 15000 and @Sal > 45000
Binding Rule to a Column:
SP_BINDRULE 'SAL_RANGE','Emp.Salary'
Subscribe to:
Post Comments (Atom)
2 comments:
Good and useful Info, thanks
thank you 4 the info!! it saves time!!
Post a Comment