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

Please note that documentation and command names may be out of date while we work furiously towards 1.0


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.



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


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


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