I would like to set the id
field already created as auto-increment, because I created the table and did not put this option for it, how could I do this?
I would like to set the id
field already created as auto-increment, because I created the table and did not put this option for it, how could I do this?
To change, simply use the following command:
For SQL Server:
ALTER TABLE <TABELA>
ALTER COLUMN <Nome_Coluna> Identity (1,1) // caso for sql server
For MySQL:
ALTER TABLE <TABELA>
MODIFY COLUMN <Nome_Coluna> AUTO_INCREMENT // caso for My SQL