Server.SystemMessages Property

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

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


<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny,  _
    GetType(SystemMessage))> _
Public ReadOnly Property SystemMessages As SystemMessageCollection
Dim instance As Server
Dim value As SystemMessageCollection

value = instance.SystemMessages
[SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny, 
public SystemMessageCollection SystemMessages { get; }
[SfcObjectAttribute(SfcContainerRelationship::ObjectContainer, SfcContainerCardinality::ZeroToAny, 
property SystemMessageCollection^ SystemMessages {
    SystemMessageCollection^ get ();
[<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny, 
member SystemMessages : SystemMessageCollection
function get SystemMessages () : SystemMessageCollection

Property Value

Type: Microsoft.SqlServer.Management.Smo.SystemMessageCollection
A SystemMessageCollection object that represents all the system messages defined on the instance of SQL Server.


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.


'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)