ap_zz_enable_constraints_sp

This is a utility procedure that makes sure that all CHECK and FORIEGN KEY constraints are enabled and trusted. After you have loaded data into a data with DOBCP, constraints are typically marked as not trusted, as constraints are not check when you run DOBCP. (They are checked if you bulk-load data as part of DBBUILD.) The optimizer ignores non-trusted constraints, which can lead to inferior query plans.

 

The procedure only considers tables that are in abasysobjects.

 

On SQL 2000 the procedure will abort on first error, on SQL 2005 it will continue. To see what data that validates the constraints, you can use DBCC CEHCKCONSTRAINTS; which gives better information (but it does not mark the constraints as trusted.)

 

There is one optional parameter @subsystem: enable constraint for this subsystem only.