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.
Author |
Topic |
desikankannan
Posting Yak Master
152 Posts |
Posted - 2012-06-14 : 05:44:07
|
how to find existing foreign key relation ship by query?Desikankannan |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-06-14 : 05:50:40
|
sys.sp_MSdependencies No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2012-06-14 : 06:07:53
|
after deleting all child tables still im getting this error"Cannot truncate table 'PWS_Interviewee' because it is being referenced by a FOREIGN KEY constraint."quote: Originally posted by desikankannan how to find existing foreign key relation ship by query?Desikankannan
Desikankannan |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2012-06-14 : 07:02:48
|
You need to drop the foreign keys in the table PWS_Interviewee.After Monday and Tuesday even the calendar says W T F .... |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2012-06-14 : 12:21:54
|
[code]-- Find Foreign Keys that reference PWS_Intervieweeselect FK_Name = object_name(object_id), FK_Referencing_Table = object_name(parent_object_id), FK_Table_Referenced = object_name(referenced_object_id), *from sys.foreign_keyswhere referenced_object_id = object_id('PWS_Interviewee','U')[/code]CODO ERGO SUM |
 |
|
|
|
|