Propriété 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.
Espace de noms : Microsoft.SqlServer.Management.Smo
Assembly : Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)
Syntaxe
'Déclaration
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.ReadOnlyAfterCreation Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase Or SfcPropertyFlags.Design)> _
Public Property QuotedIdentifierStatus As Boolean
Get
Set
'Utilisation
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)
Valeur de propriété
Type : 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.
Implémente
ITableOptions.QuotedIdentifierStatus
Exemples
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."
}
}
Voir aussi
Référence
Espace de noms Microsoft.SqlServer.Management.Smo