Viewing post 1 (of 1 total)
Same thing but this checks all tables for missing PKs:
SELECT * FROM INFORMATION_SCHEMA.TABLES T WHERE TABLE_NAME NOT IN
(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS C WHERE CONSTRAINT_TYPE = 'PRIMARY KEY')
dbgurus.com.au
October 13, 2010 at 11:10 pm
#1236628