Método Table.CheckTableDataOnly
Tests the integrity of database pages for the table data defined on the table.
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (em Microsoft.SqlServer.Smo.dll)
Sintaxe
'Declaração
Public Function CheckTableDataOnly As StringCollection
'Uso
Dim instance As Table
Dim returnValue As StringCollection
returnValue = instance.CheckTableDataOnly()
public StringCollection CheckTableDataOnly()
public:
StringCollection^ CheckTableDataOnly()
member CheckTableDataOnly : unit -> StringCollection
public function CheckTableDataOnly() : StringCollection
Valor de retorno
Tipo: System.Collections.Specialized.StringCollection
A StringCollection system object value that contains the results of the checking the integrity of the table. This includes the number of rows and the number of pages.
Comentários
This method is functionally equivalent to the Transact-SQL DBCC CHECKTABLE table name NOINDEX statement. A sample return value would be:
DBCC results for 'Production.Product'.
There are 504 rows in 13 pages for object "Production.Product".
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Exemplos
C#
Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];
foreach (Table tb in db.Tables)
{
foreach (String s in tb.CheckTableDataOnly())
{
Console.WriteLine(s);
}
}
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.CheckTableDataOnly()
}
Consulte também
Referência
Namespace Microsoft.SqlServer.Management.Smo