Table.QuotedIdentifierStatus 属性

Gets or sets a Boolean property value that specifies whether identifiers delimited by double quotation marks are Transact-SQL reserved keywords or contain characters not usually allowed by the Transact-SQL syntax rules.

命名空间:  Microsoft.SqlServer.Management.Smo
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.ReadOnlyAfterCreation Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase Or SfcPropertyFlags.Design)> _
Public Property QuotedIdentifierStatus As Boolean 
    Get 
    Set
用法
Dim instance As Table 
Dim value As Boolean 

value = instance.QuotedIdentifierStatus

instance.QuotedIdentifierStatus = value
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.ReadOnlyAfterCreation|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Design)]
public bool QuotedIdentifierStatus { get; set; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::ReadOnlyAfterCreation|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase|SfcPropertyFlags::Design)]
public:
virtual property bool QuotedIdentifierStatus {
    bool get () sealed;
    void set (bool value) sealed;
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.ReadOnlyAfterCreation|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Design)>]
abstract QuotedIdentifierStatus : bool with get, set
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.ReadOnlyAfterCreation|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Design)>]
override QuotedIdentifierStatus : bool with get, set
final function get QuotedIdentifierStatus () : boolean 
final function set QuotedIdentifierStatus (value : boolean)

属性值

类型:System.Boolean
A Boolean value that specifies how quoted identifies are handled for the table.If True, quoted identifiers are used to allow characters not usually allowed by the Transact-SQL syntax rules.If False (default), quoted identifiers are used to specify Transact-SQL reserved keywords.

实现

ITableOptions.QuotedIdentifierStatus

示例

The following code example gets and displays the quoted identifier status of each table in the AdventureWorks2012 database.

C#

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

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("AdventureWorks2012")

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."
   }
}

请参阅

参考

Table 类

Microsoft.SqlServer.Management.Smo 命名空间

其他资源

CREATE TABLE (Transact-SQL)