Database.CheckCatalog Database.CheckCatalog Database.CheckCatalog Method

Definition

Tests the integrity of the database catalog.

public:
 System::Collections::Specialized::StringCollection ^ CheckCatalog();
public System.Collections.Specialized.StringCollection CheckCatalog ();
Public Function CheckCatalog () As StringCollection
Returns

A StringCollection object value that contains a report about the integrity of the catalog in the database.

Examples

VB

PowerShell

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

$sc = new-object System.Collections.Specialized.StringCollection  
$sc = $db.CheckTables([Microsoft.SqlServer.Management.Smo.RepairType]'None')  
$c = 0  
For ($c=0; $c -le $sc.Count - 1; $c++)  
{  
   Write-Host $sc.Item($c)  
}  

Remarks

This method is equivalent to the DBCC CATALOG Transact-SQL statement.

Applies to