15

In TSQL there is

SET IDENTITY_INSERT ON;

is there a functional equivalent in SQLite?

CL.
  • 173,858
  • 17
  • 217
  • 259
DiverseAndRemote.com
  • 19,314
  • 10
  • 61
  • 70

1 Answers1

20

SQLite always allows inserting a value into the primary key column; automatically generated values are used only when the inserted value is NULL (explicitly or omitted).

For details, see the documentation.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • It says that "On an INSERT, if the ROWID or INTEGER PRIMARY KEY column is not explicitly given a value, then it will be filled automatically with an unused integer, usually one more than the largest ROWID currently in use. This is true regardless of whether or not the AUTOINCREMENT keyword is used." Does this mean that it is always AUTOINCREMENT regardless of defining? – Emil Dec 19 '16 at 17:54
  • Read the next paragraph. – CL. Dec 19 '16 at 18:38