Share via


AffinityInfo.NumaNodes Property

The NumaNode member is a collection that contains the NUMA node settings for an Instance of SQL Server.

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

Syntax

'Declaration
Public ReadOnly Property NumaNodes As NumaNodeCollection 
    Get
'Usage
Dim instance As AffinityInfo 
Dim value As NumaNodeCollection 

value = instance.NumaNodes
public NumaNodeCollection NumaNodes { get; }
public:
property NumaNodeCollection^ NumaNodes {
    NumaNodeCollection^ get ();
}
member NumaNodes : NumaNodeCollection
function get NumaNodes () : NumaNodeCollection

Property Value

Type: Microsoft.SqlServer.Management.Smo.NumaNodeCollection
Returns the NumaNodeCollection

Remarks

Access to the NumaNodes collection is provided though the [T:Microsoft.SqlServer.Management.Smo.AffinityInfo.] member of the Server object.

Examples

This example reads the NUMA node settings on the local instance of SQL Server and displays the values of the AffinityMask, GroupID and

ID members.

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

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

            dbServer.Refresh();

            Console.WriteLine("Total Numa Nodes:       {0}\n", dbServer.AffinityInfo.NumaNodes.Count);

            foreach (NumaNode numaNode in dbServer.AffinityInfo.NumaNodes)
            {
                Console.WriteLine(
                    "numaNode.AffinityMask: {0} \n" +
                    "numaNode.GroupID:      {1}\n" +
                    "numaNode.ID:           {2} : IAlterable, IScriptable\n",
                    numaNode.AffinityMask,
                    numaNode.GroupID,
                    numaNode.ID);
            }
        }
    }
}

Powershell

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

Write-Host "Total Numa Nodes:       Microsoft.SqlServer.Smo`n", 
            dbServer.AffinityInfo.NumaNodes.Count

Foreach ($numaNode in $dbServer.AffinityInfo.NumaNodes)
{
   Write-Host $numaNode
} 

See Also

Reference

AffinityInfo Class

Microsoft.SqlServer.Management.Smo Namespace