Nearly just like http://stackoverflow.com/questions/85978/query-a-tables-foreign-key-relationships, however for SQL Server 2000

For any given table 'foo', I want a question to develop a group of tables which have foreign secrets that could indicat foo.

SELECT o2.name
FROM sysobjects o
INNER JOIN sysforeignkeys fk on o.id = fk.rkeyid
INNER JOIN sysobjects o2 on fk.fkeyid = o2.id
WHERE o.name = 'foo'

Do this T-SQL:

select col_name(fkeyid, fkey) as column_name, object_name(rkeyid) as referenced_table_name, col_name(rkeyid, rkey) as referenced_column_name from sysforeignkeys where object_name(fkeyid) = 'tableNameHere' order by constid

I have rewritten the query slightly to provide you with the many other tables that depend on the particular table:

select object_name(fkeyid),
col_name(fkeyid, fkey) as column_name,
col_name(rkeyid, rkey) as referenced_column_name
from sysforeignkeys
where object_name(rkeyid) = 'tableNameHere'
order by constid

Start here

    SELECT cons.TABLE_NAME
    , cons.CONSTRAINT_NAME PK_NAME
    , cols.COLUMN_NAME 
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS cons
LEFT join INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE cols
ON cons.CONSTRAINT_NAME = cols.CONSTRAINT_NAME
WHERE cons.CONSTRAINT_TYPE = 'foreign KEY'
ORDER BY cons.TABLE_NAME
    , cons.CONSTRAINT_NAME
    , cols.COLUMN_NAME

[edit] formatting is screwed up

[edit2] no more

Parents and kids

/* this will find out all of the foreign key references for a table*/

DECLARE @tableName varchar(128)
SET @tableName = 'tCounter'

SELECT   
    pt.[name] AS 'parentTable',  
    ct.[name] AS 'childTable',  
    fk.[name] AS 'fkName', 
*   
FROM sys.foreign_keys fk        
    INNER JOIN sys.tables pt              
    	ON pt.object_ID = fk.parent_object_id        
    INNER JOIN sys.tables ct              
    	ON ct.object_ID = fk.referenced_object_id   
WHERE pt.name = @tableName      
    OR ct.name = @tableName   
ORDER BY pt.name, ct.name