Thursday, September 13, 2012

SQL Server 2008- Unique Value on One Record

In the database schema I'm working on we need one record to have a unique value (in our case 'Y'), while the other records need a non unique value ('N') i.e.  only one record can have 'Y'.

To do that we can use an index like this:

No comments:

Post a Comment