------------------------------------------------------------ Example 1: Tables don't have an PrimayKey USE db357t; GO SELECT SCHEMA_NAME(t.schema_id) AS schema_name ,t.name AS table_name FROM sys.tables t WHERE object_id NOT IN ( SELECT parent_object_id FROM sys.key_constraints WHERE type_desc = 'PRIMARY_KEY_CONSTRAINT' -- or type = 'PK' ); GO ------------------------------------------------------------ Example 2: Tables don't have an PrimayKey USE db357t; GO SELECT SCHEMA_NAME(schema_id) AS schema_name ,name AS table_name FROM sys.tables WHERE OBJECTPROPERTY(object_id,'TableHasPrimaryKey') = 0 ORDER BY schema_name, table_name; GO ------------------------------------------------------------ Example 3: Tables don't have an Index USE db357t; GO SELECT SCHEMA_NAME(schema_id) AS schema_name ,name AS table_name FROM sys.tables WHERE OBJECTPROPERTY(object_id,'IsIndexed') = 0 ORDER BY schema_name, table_name; GO