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
 Transact-SQL (2000)
 Retrieving Constraints Of Tables

Author  Topic 

sdiwi
Starting Member

27 Posts

Posted - 2005-09-29 : 12:12:22
Hi!

Is there any way to get the foreign keys that reference primary keys on a table?

(i mean a reverse of sp_fkeys)...


thnx,
peace,
sdiwi.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-30 : 01:36:56

sp_help 'tableName'

Otherwise look for views

select * from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

sdiwi
Starting Member

27 Posts

Posted - 2005-09-30 : 04:25:58
okay. thank you. that's what i was looking for (sp_help) - i knew it, but somehow never used it, because some time ago, i thought it is not possible to loop through multiple recordsets in ASP (it's soooo lame...).

thanks again, have a nice day,
peace,
sdiwi.
Go to Top of Page
   

- Advertisement -