开发者

SQL Server sys.messages

I have a database on one server for which I added some custom error messages into the sys.messages view开发者_Go百科 using the sp_addmessage stored procedure.

I find that when I restore the database onto another server the sys.messages are not copied. this is the first time i am using custom messages in the sys.messages view.

Where might I be going wrong?

Am I supposed to copy the custom error messages each time i restore the DB?

Or am I supposed to add the error messages in the master DB?

I am doing my own research but I was wondering if someone could point me in the right direction


You have to set up the custom error messages again either manually or from the original script

You can script them out of course

SELECT
   'EXEC sp_addmesssage ' + ...
FROM
   sys.messages
WHERE
   ...

Personally, this is why I don't use them: they become a maintenance overhead especially if you have different entries for different databases on the same server. I've had a 3rd party app use them and cause conflicts with another... ggrrrrr

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜