Get a List of all Primary Keys in a Database

前端 未结 5 2039
囚心锁ツ
囚心锁ツ 2021-02-02 00:21

Is this the best way to - Get a List of all Primary Keys in a Database - or is there something better?

SELECT
KCU.TABLE_NAME AS Table_Name,
KCU.CONSTRAINT_NAME A         


        
5条回答
  •  耶瑟儿~
    2021-02-02 00:50

    If you are doing this from java you can also use the getPrimaryKeys method in the databasemetadata object. Perhaps other languages have similar ways to do it.

提交回复
热议问题