Skip to Content
Former Member
Mar 25, 2014 at 10:55 AM

Need percentage of values used in an identity column


Hi All,

I am very thankful to all of you for the supprt provided at all times.

I am asked to provide the following details about an identity column for a table:

- Database name

- Table name

- Identity column

- Used number of identity values(max of identity values)

- Percentage of used values

- Next identity value to be generated

- Remaining identity value

I was able to get all these information from the global variables in sybase and with some calculations I was able to find all the identity related information as well but it takes time. For istance, the max of the column need to be found before calculating the percentage of used identity values. Since, these tables are huge(smallest table is 95 GB - bad design) the max computation itself takes time. Our Senior production DBA was able to get it with some system stored procedure which he doesn't want to disclose to us. We have requested him to at least guide us in the right direction but we are going nowhere.

I checked all the sybase documentation but did not get much help.

I sincerely request everyone to suggest me the most efficient and simple way to retrieve all this information.

Sybase ASE version is 12.5.3

Identity column


precision - 12

scale - 0

Table size is 95 GB

Table has a unique clustered index on five column and the identity column is one among them.

Please let me know if any information is required.

Thanks a lot in advance.


Nanda Kumar K