Compartilhar via


Propriedade do RDL QuotedIdentifierStatus

Obtém ou define um valor da propriedade Boolean que especifica se identificadores delimitados por aspas duplas são palavras-chave reservadas Transact-SQL ou contêm caracteres que não costumam ser permitidos pelas regras de sintaxe Transact-SQL.

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

Sintaxe

'Declaração
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.ReadOnlyAfterCreation Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase Or SfcPropertyFlags.Design)> _
Public Property QuotedIdentifierStatus As Boolean
    Get
    Set
'Uso
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)

Valor da propriedade

Tipo: System. . :: . .Boolean
Um valor Boolean que especifica como identificadores entre aspas são tratados para a tabela.
Se o valor for True, os identificadores entre aspas serão usados para permitir caracteres nem sempre permitidos pelas regras de sintaxe do Transact-SQL.
Se for False (padrão), os identificadores entre aspas serão usados para especificar palavras-chave reservadas do Transact-SQL.

Implementa

ITableOptions. . :: . .QuotedIdentifierStatus

Exemplos

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

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