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 |
|
tfountain
Constraint Violating Yak Guru
491 Posts |
Posted - 2005-09-29 : 22:39:32
|
| Is there anyway to identify using T-SQL if a foreign key is disabled or not? I have a requirement to disable all foreign keys for a heavy delete procedure but at the end I want to reenable all foreign keys, but only if I disabled them. IOW, if they were disabled prior to me running my script I don't want to reenable them. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-09-29 : 22:42:07
|
| SELECT * FROM sysobjects WHERE type='F' AND OBJECTPROPERTY(id, 'CnstIsDisabled')=1 |
 |
|
|
tfountain
Constraint Violating Yak Guru
491 Posts |
Posted - 2005-09-29 : 22:50:06
|
quote: Originally posted by robvolk SELECT * FROM sysobjects WHERE type='F' AND OBJECTPROPERTY(id, 'CnstIsDisabled')=1
You rock. Thank you Mr. Obvious!You'll only get that if you've ever heard the Bob & Tom radio show :). |
 |
|
|
|
|
|