?
Solved

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

Posted on 2010-09-08
3
Medium Priority
?
815 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 1000 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] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

The well known Cerber ransomware continues to spread this summer through spear phishing email campaigns targeting enterprises. Learn how it easily bypasses traditional defenses - and what you can do to protect your data.
Learn how to use the free Acronis True Image app to easily transfer data between iPhones and Android phones.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

762 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