Freigeben über


Table.RowCountAsDouble-Eigenschaft

Gets the number of rows in the table as a floating point value.

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

Syntax

'Declaration
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public ReadOnly Property RowCountAsDouble As Double 
    Get
'Usage
Dim instance As Table 
Dim value As Double 

value = instance.RowCountAsDouble
[SfcPropertyAttribute(SfcPropertyFlags.Standalone)]
public double RowCountAsDouble { get; }
[SfcPropertyAttribute(SfcPropertyFlags::Standalone)]
public:
property double RowCountAsDouble {
    double get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.Standalone)>]
member RowCountAsDouble : float
function get RowCountAsDouble () : double

Eigenschaftswert

Typ: System.Double
A Float64 value that specifies the number of rows in the table.

Beispiele

The following code example displays the number of rows contained in each table of the AdventureWorks2012 database.

C#

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

foreach (Table tb in db.Tables) 
{
   Console.WriteLine("The " + tb.Name + " contains " + tb.RowCountAsDouble + " rows.");
}

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" $tb.Name "conains" $tb.RowCountAsDouble "rows."
}

Siehe auch

Verweis

Table Klasse

Microsoft.SqlServer.Management.Smo-Namespace

Andere Ressourcen

Tabellen

CREATE TABLE (Transact-SQL)