Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using trigger instead of defaults?
Message
From
14/05/2005 13:56:24
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Using trigger instead of defaults?
Miscellaneous
Thread ID:
01014238
Message ID:
01014238
Views:
65
I want to create a default value for a column when new records are added but the default value depends on value of another column and I don't know how this can be best done.

For example, if I have a very simple table with just two character columns of FIELD1 & FIELD2, I want the default value of FIELD2 to be:

1) If value of FIELD1='MOMMY' then default for FIELD2='WOMEN'
2) If vlaue of FIELD2='DADDY' then default for FIELD2='MEN'

How can I go about doing this using either DEFAULT or TRIGGER? TIA.
It's "my" world. You're just living in it.
Next
Reply
Map
View

Click here to load this message in the networking platform