共用方式為


Table.OnlineHeapOperation 屬性

Gets or sets the Boolean value that determines whether the table supports online heap or index operations.

命名空間:  Microsoft.SqlServer.Management.Smo
組件:  Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)

語法

'宣告
Public Property OnlineHeapOperation As Boolean 
    Get 
    Set
'用途
Dim instance As Table 
Dim value As Boolean 

value = instance.OnlineHeapOperation

instance.OnlineHeapOperation = value
public bool OnlineHeapOperation { get; set; }
public:
property bool OnlineHeapOperation {
    bool get ();
    void set (bool value);
}
member OnlineHeapOperation : bool with get, set
function get OnlineHeapOperation () : boolean 
function set OnlineHeapOperation (value : boolean)

屬性值

型別:System.Boolean
A Boolean value that specifies whether the table supports online heap or index operations.If True, the table supports online heap operations. Otherwise, False.

範例

The following code example lists all of the tables in the AdventureWorks2012 database that support online heap operations.

C#

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

foreach (Table tb in db.Tables) 
{
   if (tb.OnlineHeapOperation == True)
   {
      Console.WriteLine("The " + tb.Name + " table supports online heap operations.");
   }
}

Powershell

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

Foreach ($tb in $db.Tables) 
{
   If ($tb.OnlineHeapOperation -eq $TRUE)
   {
      Write-Host "The" $tb.Name "table supports online heap operations."
   }
}

請參閱

參考

Table 類別

Microsoft.SqlServer.Management.Smo 命名空間

其他資源

資料表

CREATE TABLE (Transact-SQL)