Post by netzorroPost by Knut StolzePost by netzorroHi all, just a simple question I guess
I want to know the next value the identity column is going to use
Is there a way to do this?
Maybe it is in the catalog. But what's the use of such information? Even
if you have the number it will be invalid right after you queried it -
other transactions could also insert rows and consume the next value.
Thanks for your answer.
It's just because sometimes we move data from one db to other
(export/import)
And I would like to know the sequence value to import out of that range.
You can get this from the catalog (although it may not be completely
accurate if you defined the identity column with a cache).
Better is just to find the maximum value of the column (after importing
your data and reset the identity to start with max+1.
Post by netzorroAlso, what happens if the identity is in number 10 and you have records from
20 to 30 you imported manually.
What happens when the identity reaches 20 ?
Unless there is a unique or primary on the column, nothing happens --
you just get duplicate values (for the identity) in the table.