AffinityInfo.Parent AffinityInfo.Parent AffinityInfo.Parent Property


This gets the parent object of the AffinityInfo object. This value is the same as the Server object that contains the AffinityInfo member.

 property Microsoft::SqlServer::Management::Smo::Server ^ Parent { Microsoft::SqlServer::Management::Smo::Server ^ get(); };
public Microsoft.SqlServer.Management.Smo.Server Parent { get; }
Public ReadOnly Property Parent As Server
Property Value

The parent Server object that contains the AffinityInfo object. If a parent does not exist then AffinityInfo is returned.


This example displays the name of the Instance of SQL Server for the parent of the AffinityInfo member of the

Server object

using System;  
using Microsoft.SqlServer.Management.Smo;  

namespace samples  
    class Program  
        static void Main(string[] args)  
            Server dbServer = new Server("(local)");  


            Console.WriteLine("Server Name: {0}
" + "AffinityInfo.Parent: {1}", dbServer.Name, dbServer.AffinityInfo.Parent.Name); } } }


#Create the server.   
$dbServer = new-Object Microsoft.SqlServer.Smo.Server("(local)")  

Write-Host "Server Name:" $dbServer.Name`n AffinityInfo.Parent:   


Access to the AffinityInfo object is provided though the Server object.

Applies to