Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find tables without a Primary Key 1

Status
Not open for further replies.

IanWaterman

Programmer
Jun 26, 2002
3,511
0
0
GB
Is it possible to query a whole schema and find which tables if any do not have a primary Key.

Thank you

Ian
 
Sure

select a.table_name
from user_tables A
where not exists
(select null
from user_constraints b
where a.table_name = b.table_name
and B.constraint_type='P');


Bill
Lead Application Developer
New York State, USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top