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 |
|
steelkilt
Constraint Violating Yak Guru
255 Posts |
Posted - 2002-09-26 : 11:32:16
|
| Is there an existing SPROC in MS SQL Server 7.0 that will expose all rules that apply to a specific table and the fields in that table? If not, any ideas?thx |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-09-26 : 11:41:48
|
| Something like:SELECT R.name AS RuleName, C.name AS ColumnName,T.name AS TableNameFROM sysobjects R INNER JOIN syscolumns C ON R.id=C.domainINNER JOIN sysobjects T ON C.id=T.idWHERE R.Name='myRule' --change the rule name hereAlso try running sp_help 'myRule' on the rule and see what it returns. You might also want to look at all of the INFORMATION_SCHEMA views, it's possible one of them will have rule info.OK, duhhhhhhhhhh, I just re-read your question and you want to know what rules apply to a TABLE:SELECT R.name AS RuleName, C.name AS ColumnName,T.name AS TableNameFROM sysobjects R INNER JOIN syscolumns C ON R.id=C.domainINNER JOIN sysobjects T ON C.id=T.idWHERE T.Name='myTable' --change the table name hereEdited by - robvolk on 09/26/2002 11:43:39 |
 |
|
|
steelkilt
Constraint Violating Yak Guru
255 Posts |
Posted - 2002-09-26 : 11:45:17
|
| Thanks, rob. as usual, you are Aces. |
 |
|
|
|
|
|