what happened when more than one rule assigned to a column in SQL Server

this is a complex case

suppose we created 2 rules


create rule rule11
as @r =100

create rule rule111
as @r =1001

and there is a tbale

create table t11( cind int)

what will happen if we tried to bound these 2 rules to this table


now try

sp_help t11

No rowguidcol column defined.


The object ‘t11’ does not have any indexes, or you do not have permissions.

constraint_type constraint_name delete_action update_action status_enabled status_for_replication constraint_keys
RULE on column cind (bound with sp_bindrule) rule111 (n/a) (n/a) (n/a) (n/a) create rule rule111
as @r =1001

No foreign keys reference table ‘t11’, or you do not have permissions on referencing tables.
No views with schema binding reference table ‘t11’.


When binding more than one rule to a column , earlier binding will be replaced by later binding

  • http://www.bing.com/ Zariel

    Intelligence and simplicity – easy to undetrsand how you think.