Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ad hoc default value
Message
From
20/02/2002 08:29:20
 
 
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00621581
Message ID:
00622507
Views:
24
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform