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 2005 Forums
 Transact-SQL (2005)
 query help needed

Author  Topic 

soorajtnpki
Posting Yak Master

231 Posts

Posted - 2008-05-20 : 01:24:13
hi all
I know a constraint's name,say cst_name .And i know which database it is existing,say db.then can i know which table belongs to this constraint in tat db with help of a query?

tanx in advance

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-20 : 01:55:10
select TABLE_NAME,COLUMN_NAME from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE WHERE CONSTRAINT_NAME='cst_name'
Go to Top of Page

soorajtnpki
Posting Yak Master

231 Posts

Posted - 2008-05-20 : 02:33:08
ok
thanks visakh
Go to Top of Page
   

- Advertisement -