Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2803

Re: How can I reset the sequence to max ID after inserts to the table with key?

$
0
0

Hi Mert

 

So, first of all, is there a way to reset the sequence to the max ID in the table after the inserts?

If not, what would be your recommendation to overcome this issue?

How do you access the current or next value in the sequence in these auto generated sequences?

Nope, there's no way to temper with the max ID of a system generated object (e.g. the identity column).

To overcome this, you will have to use sequences manually, instead of identity column.

And there is no officially support way to access the current value. Technically you can use the the <sequence_name>.nextval but this will increase the value.

 

I'd say the general guidance here is: if you need any control over the sequence, use sequences and skip the identity column.

 

 




Viewing all articles
Browse latest Browse all 2803

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>