Why do i get the following error
Incorrect syntax near 'AUTO_INCREMENT'.
while trying to execute
CREATE TABLE Person
(
P_Id int NOT NULL AUTO_INCREMENT,
Name varchar(255),
PRIMARY KEY (P_Id)
)
What is the correct syntax?
CREATE TABLE Person(
P_Id int NOT NULL IDENTITY(1,1) PRIMARY KEY,
Name varchar(255))
You should explicitly state whether NAME
is NULL
or NOT NULL
so you are not dependant upon the current connection settings that happen to be in effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With