So, when creating a table can I create column defaults that include some sort of case statement?
For instance, I want to add a default to a column (SevType). If, when the record is entered, another column (ApptType) is 1, I want the default value of SevType to be 0. If ApptType is 2, I want the default to be 3 instead.
When I tried this (not having a clue whether it would work or not), it complained about incorrect syntax near keyword 'SET.'
ALTER TABLE tblMine
ALTER COLUMN SevType SET DEFAULT CASE ApptType WHEN 1 THEN 0 WHEN 2 THEN 3 ELSE NULL END
Seems like there must be some way to do this and I'm just having a serious case of Friday brain. Perhaps not... Any help?