共用方式為


Replicated 屬性

取得 Boolean 屬性,指定是否複寫資料表。

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

語法

'宣告
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase)> _
Public ReadOnly Property Replicated As Boolean
    Get
'用途
Dim instance As Table
Dim value As Boolean

value = instance.Replicated
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)]
public bool Replicated { get; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase)]
public:
virtual property bool Replicated {
    bool get () sealed;
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)>]
abstract Replicated : bool
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)>]
override Replicated : bool
final function get Replicated () : boolean

屬性值

型別:System. . :: . .Boolean
Boolean 值,這個值會指定是否複寫資料表。
如果為 True,則表示資料表已複寫,否則為 False (預設值)。

實作

ITableOptions. . :: . .Replicated

範例

The following code example displays the replication status for each AdventureWorks2008R2 table.

C#

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

foreach (Table tb in db.Tables) 
{
   if (tb.QuotedIdentifierStatus == true)
   {
      Console.WriteLine("Quoted identifiers in " + tb.Name + " may be used to allow characters that are normally prohibited by 
                         SQL syntax rules.");
   }
   else
   {
      Console.WriteLine("Quoted identifiers in " + tb.Name + " can only be used to specify reserved SQL keywords.");
   }
}

Powershell

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

Foreach ($tb in $db.Tables) 
{
   if ($tb.QuotedIdentifierStatus -eq $TRUE)
   {
      Write-Host "Quoted identifiers in" $tb.Name "may be used to allow characters that are normally prohibted by SQL syntax 
                  rules."
   }
   else
   {
   Write-Host "Quoted identifiers in" $tb.Name "can only be used to specify reserved SQL keywords."
   }
}