General information
Forum:
Microsoft SQL Server
Environment versions
SQL Server:
SQL Server 2000
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only