January 10, 2018 at 9:39 pm
Comments posted to this topic are about the item CREATE RULE
January 10, 2018 at 9:42 pm
Nice question ,thanks Steve.
just a note - anyone copy/pasting the query will encounter an error - "Unclosed quotation mark after the character string 'dbo.Employees.Salary"
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
January 10, 2018 at 11:00 pm
Good question thanks Steve, also spotted the typo.
...
January 11, 2018 at 12:35 am
Still, it's deprecated?! https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-bindrule-transact-sql
You are encouraged to use Constraints instead!
/morten lintrup
January 11, 2018 at 8:07 am
Just as I thought I was learning something new, I discovered that the "new" thing is deprecated.
I did all that learning for nothing. (;
January 11, 2018 at 8:34 am
Yep, even my old books online from SQL Server 2008 listed it as being deprecated. I find it funny how long some deprecated things actually hang on. :satisfied:
January 11, 2018 at 8:52 am
Trick question. Don't do it; use a constraint instead.
I've worked in a dozen IT shops over the years, and I don't think I've encountered usage of RULE based constraints in the wild. Time forgot them long ago.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
January 12, 2018 at 1:22 am
Why is usefull stuff as this deprecated? Everyone is talking about normalisation, but I still have to write the same code in a CHECK CONSTRAINT again and again and again, instead of just applying a single rule to all my fields (I believe this is one reason, why they are often not used - be honest, how many fields in your database have a check to be >= 0, because it must not contain negative numbers)
God is real, unless declared integer.
January 12, 2018 at 2:34 am
t.franz - Friday, January 12, 2018 1:22 AMWhy is usefull stuff as this deprecated? Everyone is talking about normalisation, but I still have to write the same code in a CHECK CONSTRAINT again and again and again, instead of just applying a single rule to all my fields (I believe this is one reason, why they are often not used - be honest, how many fields in your database have a check to be >= 0, because it must not contain negative numbers)
I believe it is because a UDF can be written and applied in the check constraints
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
January 12, 2018 at 7:21 am
t.franz - Friday, January 12, 2018 1:22 AMWhy is usefull stuff as this deprecated?
Heh... you sound like a kindred spirit.
My answer would be, for the same reason that other useful stuff is never implemented. For example, the "Tally" table has been an open CONNECT item for more than a decade now.
What's that reason?
One can only guess but I suspect it has something to do with marketing and whether or not MS actually wants to spend the money supporting something. From a business standpoint, that's a pretty smart thing for MS to do. From a customer standpoint, it's a terrible practice. The company and the customer simply don't have the same goals and, for the customers that do get ticked off about stuff like this, what are they going to do? Trash their entire data world to shift to some other product? Few can afford to actually do that even over time. It's the old "Big Blue" syndrome.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 12, 2018 at 8:43 am
No idea, but I suspect that someone liked constraints better and decided to not maintain this feature. MS announced somewhere that they aren't removing code anymore. With modern tools and the cloud, I think things like Rules will live on forever in limbo. No moving forward, no one taking the time to remove this.
January 12, 2018 at 9:03 am
Steve Jones - SSC Editor - Friday, January 12, 2018 8:43 AMNo idea, but I suspect that someone liked constraints better and decided to not maintain this feature. MS announced somewhere that they aren't removing code anymore. With modern tools and the cloud, I think things like Rules will live on forever in limbo. No moving forward, no one taking the time to remove this.
By "Limbo", you mean "not supported but still functional"? If so, I wonder if they'll also drop it from BOL.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 12, 2018 at 10:19 am
Steve Jones - SSC Editor - Friday, January 12, 2018 8:43 AMNo idea, but I suspect that someone liked constraints better and decided to not maintain this feature. MS announced somewhere that they aren't removing code anymore. With modern tools and the cloud, I think things like Rules will live on forever in limbo. No moving forward, no one taking the time to remove this.
Perhaps RULES and other old or obsolete syntax won't be dropped from the engine, but to use it you may need to drop the database down to a lower compatibility level. It seems that the concept of database compatibility level has been carried over to Azure.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
January 12, 2018 at 1:02 pm
Jeff Moden - Friday, January 12, 2018 9:03 AMBy "Limbo", you mean "not supported but still functional"? If so, I wonder if they'll also drop it from BOL.
My understanding is no. They'll live forever under the deprecated but not removed status.
January 12, 2018 at 1:05 pm
Eric M Russell - Friday, January 12, 2018 10:19 AMPerhaps RULES and other old or obsolete syntax won't be dropped from the engine, but to use it you may need to drop the database down to a lower compatibility level. It seems that the concept of database compatibility level has been carried over to Azure.
Why do you think this? Most items that are still enabled continue to work in current versions. I would suspect this isn't the case as adding code to check this wouldn't be worth the effort.
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply