Share via


CheckTable Método

Prueba la integridad de las páginas de la base de datos para la tabla y los índices definidos en la tabla.

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

Sintaxis

'Declaración
Public Function CheckTable As StringCollection
'Uso
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

Valor devuelto

Tipo: System.Collections.Specialized. . :: . .StringCollection
Valor de objeto del sistema StringCollection que contiene los resultados de comprobar la integridad de la tabla, incluso el número de filas y el número de páginas.

Comentarios

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

Ejemplos

C#

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

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("AdventureWorks2008R2")

foreach ($tb in $db.Tables)
{
   $tb.CheckTable()
}