I need to catch violation of UNIQUE
constraints in a special way by a C# application I am developing. Is it safe to assume that Error 2627
will always correspond to a violation of this kind, so that I can use
if (ThisSqlException.Number == 2627)
{
// Handle unique constraint violation.
}
else
{
// Handle the remaing errors.
}
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…