Server.SystemMessages Server.SystemMessages Server.SystemMessages Property

Definition

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

public:
 property Microsoft::SqlServer::Management::Smo::SystemMessageCollection ^ SystemMessages { Microsoft::SqlServer::Management::Smo::SystemMessageCollection ^ get(); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcObject(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcContainerRelationship.ObjectContainer, Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcContainerCardinality.ZeroToAny, typeof(Microsoft.SqlServer.Management.Smo.SystemMessage))]
public Microsoft.SqlServer.Management.Smo.SystemMessageCollection SystemMessages { get; }
Public ReadOnly Property SystemMessages As SystemMessageCollection
Property Value

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

Examples

Visual Basic

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$msg = $srv.SystemMessages.ItemByIdAndLanguage(14126, "us_english")  
Write-Host $msg.ID, $msg.Text  

Remarks

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.

Applies to

See Also