how to get the total number of constraints in schema in sybase

how to get the total number of constraints in schema in sybase
vkchaitu82Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
alpmoonConnect With a Mentor Commented:
Please clarify whether you need all constraints including primary key, foreign key and check constraint. Otherwise the answer might be simpler.

You can find out total number of check constraints and referential constraints by using sysconstraints. But you need to count primary keys in sysindexes as well. You can use 2nd bit of status2 column for that purpose.
0
 
Jan FranekCommented:
If you are on Sybase Adaptive Server Enterprise, there is a system table named sysconstraints - see http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.tables/html/tables/tables25.htm
0
All Courses

From novice to tech pro — start learning today.