Is there any query to find out all the tables without a Primary key or without a Unique index ?select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME not in(
select TABLE_NAME from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where CONSTRAINT_TYPE in('PRIMARY KEY', 'UNIQUE')
)|||I am assuming for Transactional Replication, minimum requirement is a unique index !
Thanks for above query|||BOL:
Microsoft SQL Server 2000 automatically creates unique indexes to enforce the uniqueness requirements of PRIMARY KEY and UNIQUE constraints.
My query returns list of tables without PRIMARY KEY or UNIQUE constraints. Try it on your database.
Former Kentuckian.
Showing posts with label cant. Show all posts
Showing posts with label cant. Show all posts
Subscribe to:
Posts (Atom)