Auto Increment problem

sc.5502@gmail.com's profile image sc.5502@gmail.com posted 3 years ago in General Permalink

How does Auto Increment work? I follow the procedure but all I get is the following error message see attached

1 attachment(s):
  • Capture2
ansgar's profile image ansgar posted 3 years ago Permalink

On MariaDB or MySQL, you will need to make a column also a primary or unique key to get no errors.

sc.5502@gmail.com's profile image sc.5502@gmail.com posted 3 years ago Permalink

I am running MS SQL Server Express not MariaDB or MySQL.

ansgar's profile image ansgar posted 3 years ago Permalink

In that case issue #1230 is related here.

sc.5502@gmail.com's profile image sc.5502@gmail.com posted 3 years ago Permalink

I am new here, what is issue #1230?

itzprobablyme's profile image itzprobablyme posted 3 years ago Permalink

This is because HeidiSQL is formatting the query for MySQL -

This is what HeidiSQL does -

CREATE TABLE "sample_table" ( "row_num" INT NOT NULL AUTO_INCREMENT, PRIMARY KEY ("row_num") )

Just copy the query generated by HeidiSQL from the output window and change as follows:

CREATE TABLE "sample_table" ( "row_num" INT IDENTITY(1,1) PRIMARY KEY )

Please login to leave a reply, or register at first.