Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ad hoc default value
Message
De
20/02/2002 08:29:20
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
00621581
Message ID:
00622507
Vues:
23
You could probably do this with a UDF that is called from the DEFAULT constraint. Just watch your concurrency. You'll have to implement some kind of gate to prevent the function from returning the same value when two connection try to insert a row at the same time (or close to the same time).

My recommendation to you is to do the insert within a stored procedure and have the stored procedure retrieve/calculate the necessary values. You'll have much better control over the locking that must occur.

-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