TechNet
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

AffinityType Enumeration

 

The AffinityType enumeration represents the possible affinity settings for an instance of SQL Server.

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

No code example is currently available or this language may not be supported.

Member nameDescription
Auto

The Auto member represents the auto affinity mode for an instance of SQL Server. In this mode, a database developer can control which threads are assigned to which CPU.

Manual

The Manual member represents the manual affinity mode for an instance of SQL Server. In this mode, the Database Engine controls thread assignments for each CPU on the server.

The following example shows how to display the current AffinityType setting for local instance of SQL Server.

C#

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("Server Microsoft.SqlServer.Smo AffinityType is T:Microsoft.SqlServer.Management.Smo.AffinityType.\n",
                dbServer.Name, dbServer.AffinityInfo.AffinityType);
        }
    }

}

Powershell

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

Write-Host Server $dbServer.Name AffinityType is 
           $dbServer.AffinityInfo.AffinityType
Return to top
Show:
© 2016 Microsoft