Saturday, February 25, 2012

Defaults

1) Defaults are applied before transactions.
Defaults incur more overhead than constraints but less than triggers.
Defaults are less functional than constraints or triggers.
2) Defaults are applied after transactions.
Defaults incur more overhead than constraints but less than triggers.
Defaults are less functional than constraints or triggers.
3) Defaults are applied before transactions.
Defaults incur more overhead than constraints but less than triggers.
Defaults are more functional than constraints but less than triggers.
4) Defaults are applied after transactions.
Defaults incur less overhead than constraints or triggers.
Defaults are more functional than constraints but less than triggers.
5)5)Defaults are applied before transactions.
Defaults can only be applied to one column per row.
Defaults are less functional than constraints or triggers.
I go with option number 4. All are agree with me ?
Thanks
JOHN
No - but the statements are poorly worded. Comparing the functionality of
defaults and constraints is inappropriate (even though MS has lumped them
together - a default is a type of constraint) since they have different
purposes. IMO, a default is less "functional" than a constraint.
Certainly, both are less functional than triggers. The terminology "before
transactions" and "after transactions" is meaningless. If I had to guess, I
would choose "before transactions" simply because the default is applied
before the insert statement completes.
I would choose 5 but the middle statement can be interpreted in different
ways. The part about "per row" is especially confusing (perhaps
intentionally) - defaults (and constraints and triggers) are never defined
at the row-level. A default is associated with a single column, but each
column can have a default.
"John" <naissani@.hotmail.com> wrote in message
news:OU4$buBIFHA.608@.TK2MSFTNGP10.phx.gbl...
> 1) Defaults are applied before transactions.
> Defaults incur more overhead than constraints but less than
triggers.
> Defaults are less functional than constraints or triggers.
> 2) Defaults are applied after transactions.
> Defaults incur more overhead than constraints but less than
triggers.
> Defaults are less functional than constraints or triggers.
> 3) Defaults are applied before transactions.
> Defaults incur more overhead than constraints but less than
triggers.
> Defaults are more functional than constraints but less than
triggers.
> 4) Defaults are applied after transactions.
> Defaults incur less overhead than constraints or triggers.
> Defaults are more functional than constraints but less than
triggers.
> 5)5)Defaults are applied before transactions.
> Defaults can only be applied to one column per row.
> Defaults are less functional than constraints or triggers.
>
>
> I go with option number 4. All are agree with me ?
>
> Thanks
> JOHN
>
>
|||On Thu, 3 Mar 2005 13:05:30 -0500, John wrote:

> I go with option number 4. All are agree with me ?
Hi John,
I don't.
Defaults are applied, neither before or after transactions, but as part
of a transaction. Anything that is applied before or after a transaction
would not be affected by a rollback of that transaction. If I ever see a
case where the insert statement is rolled back but the default values
used in that statement persist in the database, I'll be on the phone
yelling "BUG" in MSPSS' ears before you can say "Rollback".
Defaults incur less overhead than triggers. I have never compared the
overhead of defaults to that of constraints, since this would be a
meaningless comparison. I can't replace either one with the other, they
yield different functionality. It would be about as meaningless as
comparing the costs of your car with that of your microwave oven.
You could call defaults less functional than triggers, but in the same
sense as calling a chair less functional than a pile of wood, a supply
of nails, a saw, and a hammer. You can make anything you want from the
wood, including a chair, but it takes much work. If you just want to sit
down for a while, using the chair is by far the better option.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)

No comments:

Post a Comment