Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expense Computed column or trigger
Message
From
15/08/2006 13:24:45
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01145568
Message ID:
01145662
Views:
17
>A conversation cam up on which is more expensive to the db a computed column or a trigger.
>
>Example was simple Subtract col 4 from col 3. They were non nullable.
>
>So is a trigger more expensive to run vs. a computed column?
>
>My WAG was the CC.
>
>Any takers with some proof? My googles came up with Oracle and DB2 references :(
>
>__Stephen

Stephen,

It seems to me that the fact that a simple computed column is less expensive than a trigger is self-evident. To run a trigger, SQL Server has to set up a private context for the code, including the INSERTED & DELETED tables. Then the trigger code has to be executed and the environment cleaned up.

There has to be at least 100x more work for the server to run a trigger than to compute a column.

You might want to do a search at sql-server-performance.com to see if there is an article or forum post that can help you to substantiate the claim.
Previous
Reply
Map
View

Click here to load this message in the networking platform