Consider a link table with the following columns:
PersonID int NOT NULL
LocationID int NOT NULL
Active bit NOT NULL
...
The system allows each Person and Location to be configured independently. Once configured, each Person can be linked to at most one Location. If a Person moves to a new Location, the link is to be deactivated, not deleted, so that the system knows when the Person was last linked to a particular Location. A Person can have any number of inactive links, but at most one active link. A Location can have any number of Persons actively linked to it.
How would I add a constraint to this table to prevent a second active link from being created for a Person when one already exists?
Edit: I thought this was a 2008 box... turns out it's 2005, so filtered indexes won't work.