Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 chaning Foreign Key message

Author  Topic 

Ex
Posting Yak Master

166 Posts

Posted - 2005-02-14 : 00:22:01
hey all just wanted to know if there is a way to change the error message raised when a foreign key constraint is violated

for example sp_addmessage for user defined messages can you change existing server messages?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-02-14 : 07:16:03
You probably could, but I wouldn't recommend it. Changing it may cause ANOTHER error to be raised and could interfere with the original error message.

FWIW you're not alone, I would love to see an enhancement to SQL Server that allows you to provide custom error messages when defining a constraint. There's also been a lot of requests in various Microsoft newsgroups to split off the sysmessages table to each database, instead of having it in master only.
Go to Top of Page
   

- Advertisement -