Solved

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

Posted on 2010-09-08
3
805 Views
Last Modified: 2012-06-27
how to get the total number of constraints in schema in sybase
0
Comment
Question by:vkchaitu82
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Expert Comment

by:Jan_Franek
ID: 33634188
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
 
LVL 13

Accepted Solution

by:
alpmoon earned 250 total points
ID: 33634217
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

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A hard and fast method for reducing Active Directory Administrators members.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question