Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto calculations
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
00518612
Message ID:
00518782
Vues:
15
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform