You are here: Re: sql rules and udt « MsSQL Server « IT news, forums, messages
Re: sql rules and udt

Posted by Nick Chan on 09/07/07 01:14

thanks a lot guys. that's very helpful !
i wish i could use RULE to maintain employee morale (hard to get
programmers here)
gonna use CHECK for now
will vote too
On Sep 7, 5:37 am, Erland Sommarskog <esq...@sommarskog.se> wrote:
> Nick Chan (zzzxtr...@yahoo.com) writes:
> > hello, i've just started playing around with rules and udt
> > is it possible to alter rule?
>
> As Dan said, unbind, drop, recreate and rebind. All operations are
> very swift.
>
> > are rules 'slower' compared to check constraint?
>
> Rules or check constraints should make any difference for implementing
> the business rules.
>
> However, provided that a check constraint is applied WITH CHECK and
> never disabled, the optimizer can trust the constraint, which can help
> the optimizer to find a better plan. To take a simple example, say
> that you have a constraint that goes CHECK (col IN ('A', 'B', 'C'))
> and you run the query:
>
> SELECT COUNT(*) FROM tbl WHERE col = 'D'
>
> this query will return 0 instantly, and the table will never be accessed.
>
> This can never happen with a rule, as when a rule is bound, the current
> data is not checked for validity.
>
> Nevertheless, binding rules and defaults to user-defined types is a
> very useful feature. Microsoft says in Books Online for SQL 2008,
> currently in beta, that the version after SQL 2008 will not have
> rules and bound defaults. Since there is not alternative functionality,
> I think this would be a serious mistake. I have filed an item for
> this on Connecthttps://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?Fe...
>
> Feel free to vote!
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация