• GSquared (1/4/2012)


    For each pseudo-ID, there was only ever supposed to be one row marked active, and all the rest were to have a 0 in that column.

    How would you enforce that in SQL Server? I'm pretty sure it can't be done reliably with CHECK constraints. Indexed views and filtered unique indexes won't stop you updating all rows to be Active=0. Would you use triggers?