Méthode Table.CheckTable

Tests the integrity of database pages for the table and indexes defined on the table.

Espace de noms :  Microsoft.SqlServer.Management.Smo
Assembly :  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Syntaxe

'Déclaration
Public Function CheckTable As StringCollection
'Utilisation
Dim instance As Table 
Dim returnValue As StringCollection 

returnValue = instance.CheckTable()
public StringCollection CheckTable()
public:
StringCollection^ CheckTable()
member CheckTable : unit -> StringCollection
public function CheckTable() : StringCollection

Valeur de retour

Type : System.Collections.Specialized.StringCollection
A StringCollection system object value that contains the results of the checking the integrity of the table, including the number of rows and the number of pages.

Notes

This method is functionally equivalent to the Transact-SQL CHECK TABLE statement.

Exemples

C#

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

foreach (Table tb in db.Tables)
{
   tb.CheckTable();
}

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)
{
   $tb.CheckTable()
}

Voir aussi

Référence

Table Classe

Espace de noms Microsoft.SqlServer.Management.Smo

Autres ressources

Tables

CREATE TABLE (Transact-SQL)