Writing User-Defined Messages

The requirement to globalize the PT application presents a challenge to the database designers to make application messages available in all of the target languages (U.S. English, German, and Japanese) and to provide a way to easily extend the application to additional languages. The design team has two solutions:

The design team decides to extend the built-in messaging functionality of SQL Server for the following reasons:

About the sysmessages Table

The following illustration shows the column properties of the sysmessages table.

A Sample PT Error Message

The sysmessages table has a constraint on the combination of the error, dlevel, and msglangid columns. This allows the table to store one message (with the same error number) in each of the 24 languages available in SQL Server. The following illustration shows an example of one user-defined message with a value of 50002 in the error column and three values in the mslangid column: 1031 for German, 1033 for English, and 1041 for Japanese.