Freigeben über


Table.MaximumDegreeOfParallelism-Eigenschaft

Gets or sets the maximum number of processors to use in a parallel plan execution that includes the table.

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

Syntax

'Declaration
Public Property MaximumDegreeOfParallelism As Integer 
    Get 
    Set
'Usage
Dim instance As Table 
Dim value As Integer 

value = instance.MaximumDegreeOfParallelism

instance.MaximumDegreeOfParallelism = value
public int MaximumDegreeOfParallelism { get; set; }
public:
property int MaximumDegreeOfParallelism {
    int get ();
    void set (int value);
}
member MaximumDegreeOfParallelism : int with get, set
function get MaximumDegreeOfParallelism () : int 
function set MaximumDegreeOfParallelism (value : int)

Eigenschaftswert

Typ: System.Int32
An Int32 value that specifies the maximum number of processors to use in a parallel plan execution.

Beispiele

The following code example shows how to specify the maximum number of processors used for parallel plan executions that include the defined table.

Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];

Table tb = new Table(db, "Test Table");
Column col1 = new Column(tb, "Name", DataType.NChar(50));
Column col2 = new Column(tb, "ID", DataType.Int);

tb.Columns.Add(col1); 
tb.Columns.Add(col2); 
tb.MaximumDegreeOfParallelism = 3;
tb.Create();

Console.WriteLine("The maximum number of processors that can be used in parallel plan execution for this table is " + tb.MaximumDegreeOfParallelism);

Powershell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2012")

#Create the Table
$tb = new-object Microsoft.SqlServer.Management.Smo.Table($db, "Tesghjt Table")
$col1 = new-object Microsoft.SqlServer.Management.Smo.Column($tb, "Name", [Microsoft.SqlServer.Management.Smo.DataType]::NChar(50))
$col2 = new-object Microsoft.SqlServer.Management.Smo.Column($tb, "ID", [Microsoft.SqlServer.Management.Smo.DataType]::Int)
$tb.Columns.Add($col1)
$tb.Columns.Add($col2)
$tb.MaximumDegreeOfParallelism = 3
$tb.Create()

Write-Host "The maximum number of processors that can be used in parallel plan execution for this table is" 
            $tb.MaximumDegreeofParallelism

Siehe auch

Verweis

Table Klasse

Microsoft.SqlServer.Management.Smo-Namespace

Andere Ressourcen

Tabellen

CREATE TABLE (Transact-SQL)