Oggi ho scoperto che le colonne con incremento automatico in SQL Server non sono così ingestibili come pensavo poco tempo fa… infatti si può sapere e modificare qual’è l’id successivo che verrà generato tramite comandi BCC:
Per sapere qual’è il “seed” della tabella:
[sql]
DBCC checkident (‘nome_tabella’)
[/sql]
Per reimpostare il “seed” della tabella:
[sql]
DBCC checkident (‘testi’, reseed)
[/sql]
Per reimpostare il “seed” della tabella ad un certo valore:
[sql]
DBCC checkident (‘testi’, reseed, 144)
[/sql]