Similar but NOT IDENTICAL to SQL Server 2000 - Query a Table’s Foreign Key relationships
I need a T-SQL statement that will work SQL 2000 that given a table name, will return the foreign key relationships for that table e.g.
Table MyFristTable has a foreign key to MySecondTable, where MyFirstTable.ColA must be in MySecondTable.ColB. I'd be delighted, if the sql statement (or stored proc) is ran for MyFirstTable and returned a result set on the lines of
Column | FK_Table | FK_COLUMN
----------------------------------
ColA | MySecondTable | ColB
NB: I have samples for SQL 2005 that won't work because they rely on sys.foreign_key_columns
I'd rather not have to parse out the results of the sp_help statement.
Thanks,