Table.EnumLastStatisticsUpdates Table.EnumLastStatisticsUpdates Table.EnumLastStatisticsUpdates Method

Definition

Enumerates a list of information about the most recent statistics updates.

Overloads

EnumLastStatisticsUpdates() EnumLastStatisticsUpdates() EnumLastStatisticsUpdates()

Enumerates a list of information about the most recent statistics updates.

EnumLastStatisticsUpdates(String) EnumLastStatisticsUpdates(String) EnumLastStatisticsUpdates(String)

Enumerates a list of information about the most recent statistics updates for the specified statistic counter.

EnumLastStatisticsUpdates() EnumLastStatisticsUpdates() EnumLastStatisticsUpdates()

Enumerates a list of information about the most recent statistics updates.

public:
 System::Data::DataTable ^ EnumLastStatisticsUpdates();
public System.Data.DataTable EnumLastStatisticsUpdates ();
Public Function EnumLastStatisticsUpdates () As DataTable
Returns

A DataTable system object value that contains a list of information about the most recent statistics updates.

Column
Data type
Description
NameString The name of the key or index on which the statistic counter is based.
LastUpdatedDateTime The date and time when the statistics were last updated.

Examples

The following code example demonstrates how to enumerate statistic update information.

C#

Server srv = new Server("(local)");  
Database db = srv.Databases["AdventureWorks2012"];  
lastStatisticsUpdates[];  
Table tb1 = db.Tables[0];  
Table tb2 = db.Tables[1];  

DataTable[] lastSUpdates = new DataTable[2] {tb1.EnumLastStatisticsUpdates(), tb2.EnumLastStatisticsUpdates()}  

Powershell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$db = New-Object Microsoft.SqlServer.Management.Smo.Database  
$db = $srv.Databases.Item("AdventureWorks2012")  

$tb1 = $db.Tables[0]  
$tb2 = $db.Tables[1]  
$lastSUpdates = @($tb1.EnumLastStatisticsUpdates(), $tb2.EnumLastStatisticsUpdates());  
See Also

EnumLastStatisticsUpdates(String) EnumLastStatisticsUpdates(String) EnumLastStatisticsUpdates(String)

Enumerates a list of information about the most recent statistics updates for the specified statistic counter.

public:
 System::Data::DataTable ^ EnumLastStatisticsUpdates(System::String ^ statname);
public System.Data.DataTable EnumLastStatisticsUpdates (string statname);
Public Function EnumLastStatisticsUpdates (statname As String) As DataTable
Parameters
statname
String String String

A String value that specifies the statistic counter to which to limit the results.

Returns

A DataTable system object value that contains a list of information about the most recent statistics updates.

Column
Data type
Description
NameString The name of key or index on which the statistic counter is based.
LastUpdatedDateTime The date and time when the statistics were last updated.

Examples

The following code example demonstrates how to enumerate statistic update information.

C#

Server srv = new Server("(local)");  
Database db = srv.Databases["AdventureWorks2012"];  
Table tb = db.Tables["Address", "Person"];  

DataTable dt;  
dt = tb.EnumLastStatisticsUpdates("PK_Address_AddressID");  

Powershell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$db = New-Object Microsoft.SqlServer.Management.Smo.Database  
$db = $srv.Databases.Item("AdventureWorks2012")  

$tb = $db.Tables.Item("Address", "Person")  
$dt = $tb.EnumLastStatisticsUpdates("PK_Address_AddressID")  

Applies to