I have a table that has an "id" field but it is not defined as auto-incremented within the DB, there is a possibility that when inserting a record, it indicates that the "id" is going to be a self-incremented field using C #.
I have a table that has an "id" field but it is not defined as auto-incremented within the DB, there is a possibility that when inserting a record, it indicates that the "id" is going to be a self-incremented field using C #.
It should be calculated by obtaining the last value and then adding 1:
INSERT INTO Tabla
(Id, Valor)
VALUES((SELECT MAX(Id) + 1 FROM Tabla), 'Descripción del campo' )