cancel
Showing results for 
Search instead for 
Did you mean: 

how to find foreign keys and their attributes in my database

Former Member
1,916

I am trying to find out all the foreign keys declared in my database along with the attributes of each key, for example is there a delete or update action defined for that key, etc. if I can some how get the script that defines these keys that would be even better. Is there a way to do that?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

If you can unload the full schema for the database, that will provide the statements used to create tables, foreign keys, etc. This can be done with dbunload -n.

Otherwise, you may be able to piece the information together from certain systems views:

Integrity rules in the system tables

reimer_pods
Participant
0 Kudos

@Tyson: that link didn't work for me, I had to change it to this one:
http://dcx.sybase.com/index.html#1201/en/dbusage/intrevw.html

Breck_Carter
Participant

Tyson lives inside the Golden Palace where all things are possible 🙂

Former Member
0 Kudos

Ah, yes, that would be an oversight on my part. I have a DNS suffix for .sybase.com configured on my machine, and occasionally forget that when I link to a page.

I've edited my answer to include the full domain name.