Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Tables not in relationship

Author  Topic 

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2004-10-26 : 13:14:34
How can I find all tables in a db that are not particpating in a relationship.

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-10-26 : 14:42:17
[code]select object_name(id) as non_ref_table
from sysobjects where id not in
(select fkeyid from sysreferences union select rkeyid from sysreferences)
and type = 'U'[/code]

rockmoose
/* Chaos is the nature of things...Order is a lesser state of chaos */
Go to Top of Page

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2004-10-26 : 15:04:12
Thank you!

Go to Top of Page
   

- Advertisement -