Need to identigy Primary key from a table using Select
I was trying to identify the Primary keys from a table. I can do show table tablename or help table tablename which would give me details about whole tables. Is it some command available to display PK or FK columns defined in a table
Re: Need to identigy Primary key from a table using Select
Hi Rishab, if the table was created with a Primary Key constraint, it has been replaced by a UPI/USI. There's a PrimaryKeyIndexId in dbc.tables, which indicates the original PK and relates to dbc.indices.IndexNumber. In current releases there's also a "K" in dbc.indices.Indextype for a PK.