I need to make conditional requirements for fields. I’m not sure how this looks in SQL. I’m using Management Studio with SQL Server 2008. Essentially I would like a field to become required only when another field has data entered into it. I researched triggers, and I think that’s what I need, but I’m not sure what type (DDL, DML, ect.).
For example:
When the user enters a time they must also enter a date, but if no time is entered then no date is required. SQL would send an error and not allow the user to complete the record without entering a date while the time field is filled.
Thanks!
You can use a check constraint.
Test with this: