Bryan Whitaker (1/16/2009)
I'm familiar with using sp_addmessage to generate user-defined error messages and triggering them with RAISERROR from my sp's. Can a CHECK CONSTRAINT be created that, when triggered, returns a specific user-defined message vs. the generic message 547 (UPDATE/INSERT statement conflicted with COLUMN CHECK constraint...) ?
Thanks,
Bryan
The best you can get is to name the constraint as close as possible to the message you want but that is a hack.
The real solution is to TRAP the error on the Client and act (bubble up the right exception message) accordingly!