I have a following table, Client
.
create table Client (
ClientID int identity primary key,
TaxID varchar(12),
SSN varchar(12)
)
GO
Client can have either TaxID or SSN or both. But either one should exist.
Currently, I am enforcing the rule thru following trigger.
create trigger trgClient_UniqueTaxIDSSN
on Client
after Insert, Update
as
--; Check if either TaxID or SSN is not null.
But is there a way to declare a constraint to enforce the rule?