How to get the primary key name from the request

I am looking for a query that tells me NAME of the primary key of a table
Example: In oracle, I do this

select CONSTRAINT_NAME from user_constraints, where table_name = 'CT' AND CONSTRAINT_TYPE = 'P'

how to do it in sybase?

+4
source share
1 answer

Try as follows:

select name from sysindexes where indid > 0 and status2 & 2 = 2 
+4
source

Source: https://habr.com/ru/post/1486563/


All Articles