Le colonne con incremento automatico di SQL Server
{ Posted on dic 21 2011 by maury }
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:
DBCC checkident ('nome_tabella')
Per reimpostare il “seed” della tabella:
DBCC checkident ('testi', reseed)
Per reimpostare il “seed” della tabella ad un certo valore:
DBCC checkident ('testi', reseed, 144)

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid (Albert Einstein)
