Re: Getting relationship data
From: Anith Sen (anith_at_bizdatasolutions.com)
Date: 06/07/04
- Previous message: Anith Sen: "Re: how do i create a view within a procedure that uses a variable defined in the procedure"
- In reply to: Anthony: "Getting relationship data"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 7 Jun 2004 12:30:10 -0500
You can start by querying INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS view.
If you are interested in viewing the reference constraints that exist in
your database, you can do:
SELECT o1.name AS "tablename",
OBJECT_NAME( f1.constid ) AS "constraintname",
OBJECT_NAME( f1.rkeyid ) as referencedtable
FROM sysobjects o1
LEFT OUTER JOIN sysconstraints c1
ON o1.id = c1.id
AND c1.status &3 = 3
LEFT OUTER JOIN sysforeignkeys f1
ON c1.constid = f1.constid
WHERE o1.type = 'u'
ORDER BY "referencedtable", "tablename" ;
-- Anith
- Previous message: Anith Sen: "Re: how do i create a view within a procedure that uses a variable defined in the procedure"
- In reply to: Anthony: "Getting relationship data"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|