Compartir a través de


Table.ID Propiedad

Gets the ID value that uniquely identifies the table.

Espacio de nombres:  Microsoft.SqlServer.Management.Smo
Ensamblado:  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Sintaxis

'Declaración
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase)> _
Public ReadOnly Property ID As Integer 
    Get
'Uso
Dim instance As Table 
Dim value As Integer 

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

Valor de la propiedad

Tipo: System.Int32
An Int32 value that specifies the ID value that uniquely identifies the table.

Implementa

ITableOptions.ID

Ejemplos

The following code example shows how to list the ID value of each table in the AdventureWorks2012 database.

C#

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

foreach (Table tb in db.Tables) 
{
   Console.WriteLine("The ID of the " + tb.Name + " table is " + tb.ID.ToString());
}

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) 
{
   Write-Host "The ID of the" $tb.Name "table is" $tb.ID
}

Vea también

Referencia

Table Clase

Espacio de nombres Microsoft.SqlServer.Management.Smo

Otros recursos

Tablas

CREATE TABLE (Transact-SQL)