Table.CheckTable 메서드

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

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
Public Function CheckTable As StringCollection
‘사용 방법
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

반환 값

유형: 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.

주의

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

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()
}

참고 항목

참조

Table 클래스

Microsoft.SqlServer.Management.Smo 네임스페이스

관련 자료

테이블

CREATE TABLE(Transact-SQL)