Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto calculations
Message
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00518612
Message ID:
00518782
Views:
14
The traditional approach would be to create an INSERT trigger. Starting with v7.0, SQL Server supports computed columns.

CREATE TABLE foo (
c1 integer,
c2 integer,
c3 AS c1 + c2
)

The thing to understand about computed columns is that their not materialized. The value is generated on the fly when accessed.

The approach to take depends on what you're going to do with the column. And I guess the other question is "do you really need to store the calculated value?"

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform