Answers for "find primary key in a table in sql server"

SQL
0

get primary key of table

SELECT a.COLUMN_NAME
FROM all_cons_columns a INNER JOIN all_constraints c 
     ON a.constraint_name = c.constraint_name 
WHERE c.table_name = 'TBL'
  AND c.constraint_type = 'P';
Posted by: Guest on July-23-2020

Code answers related to "find primary key in a table in sql server"

Code answers related to "SQL"

Browse Popular Code Answers by Language