I've got a model that I need to add a unique index field (this is a new field); So I've done
during the model upgrade I get the following error:
This unique code is in addition to the numeric Key field. I understand why I'm getting the SQL error - what I'm not sure about is the DO.net way of fixing this. What I really want is a way of ensuring that if the UniqueCode is present the DB will enforce the uniqueness. |
Greetings Richard, Sorry for the delay. I suppose you use SQL Server 2008 or higher. If so, you could use one of the exciting features of DataObjects.Net - partial indexes support. Here is an example:
} P.S. |