SQL Server: Show all the PRIMARY KEYS for a TABLE

For SQL Server 2005 +

Notes:

  • Change line (1) to specify the table name. Removing this line will list PRIMARY KEYS for all TABLES.

Leave a Reply

Your email address will not be published. Required fields are marked *