Is it possible to produce a list of all tables within a specified database that don't have a primary key?
This is SQL Server 2005.
Is it possible to produce a list of all tables within a specified database that don't have a primary key?
This is SQL Server 2005.
This really belongs more on StackOverflow rather than ServerFault, doesn't it?
Anyway, I found this script that I posted a few years back: List all tables without a primary key. It works for SQL 2000+.
yikes! information schema views are ugly.
If your database is 2005, then you should use the catalog views, as recommended by MS
Here's my solution: