Server.SystemMessages Property

Represents a collection of SystemMessage objects. Each SystemMessage object represents a system message defined on the instance of Microsoft SQL Server.

Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

public SystemMessageCollection SystemMessages { get; }
/** @property */
public SystemMessageCollection get_SystemMessages ()

public function get SystemMessages () : SystemMessageCollection

Property Value

A SystemMessageCollection object that represents all the system messages defined on the instance of SQL Server.

Updated text:

The SystemMessages property points to the SystemMessageCollection object, which references the system messages on the instance of SQL Server. You can use the collection to reference the predefined system messages. Use the UserDefinedMessages property to access user-defined messages.

This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Reference an existing system message using the ItemByIdAndLanguage method.
Dim msg As SystemMessage
msg = srv.SystemMessages.ItemByIdAndLanguage(14126, "us_english")
'Display the message ID and  text.
Console.WriteLine(msg.ID.ToString + " " + msg.Text)

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms



New content:
  • Added code sample to the Example section.

  • Added to the description in the Remarks section.

Community Additions