Can you any one tell me how to generate auto number in SQL? I have tried but it shows the following error
“Incorrect sytnax near AUTO_INCREMENT”.
What am I doing wrong?
create table auto1
(
Sno int NOT NULL AUTO_INCREMENT,
fname varchar(50)
)
I assume you are using SQL-Server where the syntax is different compared to other DB engines
See here for details on table creation.