Get a List of all Primary Keys in a Database

前端 未结 5 1958
囚心锁ツ
囚心锁ツ 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:40

    The following syntax give you all constraints in database in use.

    select * from sys.key_constraints;
    

提交回复
热议问题