Press "Enter" to skip to content

Finding Tables with Primary Keys in SQL Server

Tom Collins gets a question:

Question: How can I find tables in a SQL Server database that have a Primary Key ? 

Click through for three separate ways to answer this question, though one of them uses the dreaded ANSI-89 syntax, which is loathsome. An upgrade to ANSI-92 syntax, however, would make it a fine query.