Skip to main content

I want to create a table which will auto increment the id. Identity is not working, do we have any other solution?

CREATE TABLE production_categories (

    category_id INT IDENTITY (1, 1) PRIMARY KEY,

    category_name VARCHAR (255) NOT NULL

);

Hi Amit,

Many thanks for reaching out.

Could you please try the following:

CREATE TABLE production_categories (
category_id IDENTITY (1, 1) PRIMARY KEY,
category_name VARCHAR (255) NOT NULL
);

Kindly let us know if it will work?

Thank you for your patience, understanding and collaboration in this matter.

Best regards,
Valmira Abdiu

Reply