Home > Enterprise >  Insert Into SQL Command
Insert Into SQL Command

Time:08-17

I need help with a SQL command. I would like to create several data in the database, but the table has a "counter" (generator). Before I create data in a new row, I have to call up and increase the counter with "SELECT NEXT VALUE".

What command do I have to enter if I use insert into for the generator once but want to insert data at the same time (values)

CodePudding user response:

Hi it very simple you can add ID column or any name with int datatype and for that you enable identity as true, it will auto increment when new data is inserted. No need to any code for that.

Note: No need to pass value for ID, SQL do itself.

CodePudding user response:

Check: Easiest way to create an auto increment field in Firebird database

When this is setup you don't have to add the key to the insert statement. As the name states, this will be auto incremented.

  • Related