Compartilhar via


Propriedade do RDL LinkedServers

Representa uma coleção de objetos LinkedServer. Cada objeto LinkedServer representa um servidor vinculado registrado na instância do SQL Server.

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

Sintaxe

'Declaração
<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny,  _
    GetType(LinkedServer))> _
Public ReadOnly Property LinkedServers As LinkedServerCollection
    Get
'Uso
Dim instance As Server
Dim value As LinkedServerCollection

value = instance.LinkedServers
[SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny, 
    typeof(LinkedServer))]
public LinkedServerCollection LinkedServers { get; }
[SfcObjectAttribute(SfcContainerRelationship::ObjectContainer, SfcContainerCardinality::ZeroToAny, 
    typeof(LinkedServer))]
public:
property LinkedServerCollection^ LinkedServers {
    LinkedServerCollection^ get ();
}
[<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny, 
    typeof(LinkedServer))>]
member LinkedServers : LinkedServerCollection
function get LinkedServers () : LinkedServerCollection

Valor da propriedade

Tipo: Microsoft.SqlServer.Management.Smo. . :: . .LinkedServerCollection
Um objeto LinkedServerCollection que representa todos os servidores vinculados registrados na instância do SQL Server.

Comentários

The LinkedServers property points to the LinkedServerCollection object. You can use the collection to reference the linked servers registered on the instance of SQL Server.

Exemplos

Visual Basic

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Display the linked servers.
Dim lksv As LinkedServer
For Each lksv In srv.LinkedServers
   Console.WriteLine(lksv.Name)

Next

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
foreach ($lksv in $srv.LinkedServers)
{
   Write-Host $lksv.Name
}