Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Check if a primary keys exists

    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

Viewing post 1 (of 1 total)