Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

how to get tables involved in constraint
Hi,
The following request select a constraint from TABLE_CONSTRAINT with
the name specified in the where clause:

select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where
constraint_name =  'FK__51OtherParties_
_51Claims'

It returns:

http://graphicsxp.free.fr/constraint.JPG

So I have TABLE_NAME that correspond to the first table involved in the
constraint, but how do I get 51Claims ????


Thank you


Report this thread to moderator Post Follow-up to this message
Old Post
Sam
01-18-06 04:23 PM


Re: how to get tables involved in constraint
Hi, Sam

You can use something like this:

SELECT TC.TABLE_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC
INNER JOIN INFORMATION_SCHEMA. REFERENTIAL_CONSTRAI
NTS RC
ON TC.CONSTRAINT_NAME=RC. UNIQUE_CONSTRAINT_NA
ME
AND TC. CONSTRAINT_SCHEMA=RC
. UNIQUE_CONSTRAINT_SC
HEMA
WHERE RC.CONSTRAINT_NAME =  'FK__51OtherParties_
_51Claims'

Razvan


Report this thread to moderator Post Follow-up to this message
Old Post
Razvan Socol
01-18-06 04:24 PM


Re: how to get tables involved in constraint
Hi Razvan,

Many thanks, it works !


Report this thread to moderator Post Follow-up to this message
Old Post
Sam
01-18-06 04:24 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 04:02 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006