Clase Cpu
The Cpu class contains information about one CPU on an instance of SQL Server.
Jerarquía de herencia
System. . :: . .Object
Microsoft.SqlServer.Management.Smo..::..Cpu
Espacio de nombres: Microsoft.SqlServer.Management.Smo
Ensamblado: Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)
Sintaxis
'Declaración
Public NotInheritable Class Cpu
'Uso
Dim instance As Cpu
public sealed class Cpu
public ref class Cpu sealed
[<SealedAttribute>]
type Cpu = class end
public final class Cpu
El tipo Cpu expone los siguientes miembros.
Propiedades
Nombre | Descripción | |
---|---|---|
AffinityMask | Gets or sets the AffinityMask member of the Cpu class. | |
GroupID | Gets the current value of the GroupID member. | |
ID | Gets the ID of the CPU that is represented by this Cpu object. | |
NumaNodeID | Gets the NumaNodeID of the NUMA node to which this Cpu object belongs. |
Arriba
Métodos
Nombre | Descripción | |
---|---|---|
Equals | (Se hereda de Object.) | |
Finalize | (Se hereda de Object.) | |
GetHashCode | (Se hereda de Object.) | |
GetType | (Se hereda de Object.) | |
MemberwiseClone | (Se hereda de Object.) | |
ToString | (Se hereda de Object.) |
Arriba
Comentarios
Access to the CPU class is though the Cpus collection property.
To change the CPU settings on an instance of SQL Server, users must have ALTER permission on the database.
Ejemplos
The following code example displays the total number of CPUs on the 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)");
Console.WriteLine(
"Total number of CPUs for server {0} is {1}.",
dbServer.Name,
dbServer.AffinityInfo.Cpus.Count);
}
}
}
Powershell
$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host "Total number of CPUs for server" $dbServer.Name "is" $dbServer.AffinityInfo.Cpus.Count
Seguridad para subprocesos
Cualquier miembro público static (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancia sean seguros para subprocesos.