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 2000 Forums
 SQL Server Development (2000)
 argghh..how to bind rule to multiple columns?

Author  Topic 

steelkilt
Constraint Violating Yak Guru

255 Posts

Posted - 2002-10-23 : 14:08:44
I have an odd problem: my column names are so long that I can't view them properly when trying to bind rules using Enterprise Manager. So, I figured I'd just use Query Analyzer and bind rules by hand. My problem, I can't get the proper syntax to bind one rule to multiple columns in a table.

Basic syntax:

sp_bindrule '<=12', 'tablename.[columname]

How to list multiple columns to be bound?

thx



robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-23 : 14:13:32
You gotta do one column at a time.

Go to Top of Page

steelkilt
Constraint Violating Yak Guru

255 Posts

Posted - 2002-10-23 : 14:27:52
166 fields, one at a time, I'm at field number 74 now...

what a drag. Anyone know the logic behind this limitation?

thx

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-23 : 14:30:36
Well, here's some logic: if you're binding the same rule to multiple columns in the same database table, logic suggests that they're the same kind of data, so you have repeating groups in the same table, which is a denormalized structure, and in normalizing the table you reduce those multiple columns to one or two instead of 166, and then it's not a problem or limitation anymore.

OK, so it's not GREAT logic, but I wouldn't call it a limitation either.

Seriously, what are these 166 columns storing anyway?

Edited by - robvolk on 10/23/2002 14:40:36
Go to Top of Page

steelkilt
Constraint Violating Yak Guru

255 Posts

Posted - 2002-10-23 : 15:49:24
Yes, I see the logic, I guess. This table has many columns that represent unique test variables, all INT data types. These test variables need min/max data entry rules.



Go to Top of Page

Lavos
Posting Yak Master

200 Posts

Posted - 2002-10-23 : 23:03:40
Exactly how long *are* your columns names anyway? And a second question, why are they that long? (Yeah, I know, most likely a naming convention adopted in order to make the code "easier" to read.)

----------------------
"O Theos mou! Echo ten labrida en te mou kephale!"
Go to Top of Page

Andraax
Aged Yak Warrior

790 Posts

Posted - 2002-10-24 : 02:09:48
Couldn't you make a script looping through all the columns from information_schema.columns or syscolumns for that table, binding the rule using dynamic SQL?

Just a thought.

Go to Top of Page
   

- Advertisement -