Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesHi, 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
Post Follow-up to this messageHi, 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
Post Follow-up to this messageHi Razvan, Many thanks, it works !
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread