Is it possible to obtain the next value that will be used at an identity column using sql statements ?
I have noticed that the value is written at .script after shutdown (for instance if my table has ID = 1 there is a line at .script that alter column id to start restart at 2). Is it possible to obtain this value ?
Thank you very much for your attention.
The COLUMNS table has the properties of the identity columns, but not the next value for the sequence. For independent sequences, the SEQUENCES table has the next value info. The following show it for 1.9. For 1.8, the talbe names have a SYSTEM_ prefix. How do you intend to use this value? If it is generally useful, we may intoduce some functions for it.
SET SCHEMA INFORMATION_SCHEMA
SELECT * FROM SEQUENCES
SELECT * from COLUMNS WHERE IS_IDENTITY = 'YES'
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.