

If an identity column is getting close to the limit of the datatype, you need to know so that you can avoid logical problems in your application and SQL Server errors. This metric measures the number of identity columns that are near to the limit per database. ORDER BY "Percent" DESC Identity columns near limit, 4.5 out of 5 based on 8 ratings Metric definition Name

SELECT OBJECT_NAME(a.Object_id) as table_name,ĬONVERT(bigint, ISNULL(a.last_value,0)) AS last_value,

If you want to carry out further analysis, run this query to find which tables have the identity column near to the limit: This is a limitation of the datatype, not the identity. Server: Msg 8115, Level 16, State 1, Line 1Īrithmetic overflow error converting IDENTITY to data type smallint. For example, if you created an IDENTITY column of smallint datatype, if you try to insert more than 32767 rows in the table, you will get the following error: If your application relies on identity columns, use this metric to measure the number of identity columns that are near to the limit per database.
#Red gate software ltd sql prompt 5 install
If you are using Redgate’s SQL Server monitoring tool, SQL Monitor, you can instantly install and run this metric on your servers. Metrics install automatically if you have SQL Monitor installed.
