문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
번역
영문

Restore.ReadSuspectPageTable 메서드

Returns the suspect page table for the targeted instance of SQL Server.

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

public DataTable ReadSuspectPageTable(
	Server server
)

매개 변수

server
유형: Microsoft.SqlServer.Management.Smo.Server
A Server object that represents the instance of SQL Server that is targeted by the restore operation.

반환 값

유형: System.Data.DataTable
A DataTable object that specifies the suspect page table data.

The following code example demonstrates how to display data from the suspect page table

VB

Dim srv As Server = New Server()
Dim res As Restore = New Restore()
Dim backup As Backup = New Backup()
Dim dt As DataTable

backup.Devices.AddDevice("C:\AdventureWorks2012Backup.bak", DeviceType.File)
backup.Database = "AdventureWorks2012"
backup.Action = BackupActionType.Database
backup.Initialize = True
backup.SqlBackup(srv)

res.Devices.AddDevice("C:\AdventureWorks2012Backup.BAK", DeviceType.File)
dt = res.ReadSuspectPageTable(srv)

If dt.Rows.Count = 0 Then
   Console.WriteLine("There are no entries on the suspect page list")
Else
   For Each r As DataRow In dt.Rows
      For Each c As DataColumn In dt.Columns
         Console.WriteLine(c.ToString + " = " + r(c).ToString())
      Next
   Next
End If

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$res = new-object Microsoft.SqlServer.Management.Smo.Restore
$backup = new-object Microsoft.SqlServer.Management.Smo.Backup

$backup.Devices.AddDevice("C:\AdventureWorks2012Backup.bak", [Microsoft.SqlServer.Management.Smo.DeviceType]::File)
$backup.Database = "AdventureWorks2012"
$backup.Action = [Microsoft.SqlServer.Management.Smo.BackupActionType]::Database
$backup.Initialize = $TRUE
$backup.SqlBackup($srv)

$res.Devices.AddDevice("C:\AdventureWorks2012Backup.bak", [Microsoft.SqlServer.Management.Smo.DeviceType]::File)
$dt = $res.ReadSuspectPageTable($srv)

if ($dt.Rows.Count -ne 0)
{
   foreach($r in $dt.Rows)
   {
      foreach ($c in $dt.Columns)
      {
         Write-Host $c "=" $r[$c]
      }
   }
}
else 
{ 
   Write-Host "There are no entries on the suspect page list"
}

커뮤니티 추가 항목

추가
표시: