Unique Index that Allows NULLS

suggest change
CREATE UNIQUE INDEX idx_license_id 
   ON Person(DrivingLicenseID) WHERE DrivingLicenseID IS NOT NULL
GO

This schema allows for a 0..1 relationship - people can have zero or one driving licenses and each license can only belong to one person

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Indexes:
*Unique Index that Allows NULLS

Table Of Contents