Database.CheckIdentityValues Database.CheckIdentityValues Database.CheckIdentityValues Method

Definition

Verifies the integrity of all identity columns in tables in the database.

public:
 void CheckIdentityValues();
public void CheckIdentityValues ();
Public Sub CheckIdentityValues ()

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 CHECKIDENT Transact-SQL statement.

Applies to