dbatools is a free PowerShell module with over 180 SQL Server administration, best practice and migration commands included.


Test-DbaIdentityUsage

Displays information relating to IDENTITY seed usage. Works on SQL Server 2008 and above.

IDENTITY seeds have max values based off of their data type. This command will locate identity columns and report the seed usage.

Screenshots

Examples

Check identity seeds for servers sql2008 and sqlserver2012.

Test-DbaIdentityUsage -SqlServer sql2008, sqlserver2012

Check identity seeds on server sql2008 for only the TestDB database.

Test-DbaIdentityUsage -SqlServer sql2008 -Database TestDB

Check identity seeds on server sql2008 for only the TestDB database, limiting results to 20% utilization of seed range or higher.

Test-DbaIdentityUsage -SqlServer sql2008 -Database TestDB -Threshold 20

Author

This command was created by Brandon Abshire. You can find Brandon blogging at netnerds.net.

Get-Help

From PowerShell, execute Get-Help Test-DbaIdentityUsage -Detailed for more information on this function.

Source Code

Want to see the source code? View Test-DbaIdentityUsage.ps1 on GitHub
 

Related commands