I have a table called EMPLOYEE_DETAILS
with these columns:
@EMPLOYEEE_ID,
@EMPLOYEE_FIRSTNAME,
@EMPLOYEE_MIDDEL_NAME,
@EMPLOYEE_LAST_NAME,
@EMPLOYEE_CODE,
@EMPLOYEE_WORKDEPT,
@EMPLOYEE_PHONENO,
@EMPLOYEEE_HIREDATE,
@EMPLOYEE_JOB,
@EMPLOYEE_POSITION,
@EMPLOYEE_SEX,
@EMPLOYEE_BIRTHDATE,
@EMPLOYEE_SALARY,
@EMPLOYEE_BONUS,
@EMPLOYEE_COMM
Now, EMPLOYEE_ID
is the primary key, but it does not have autoincrement value.
How to provide autoincrement value if the column has already created without deleting the column structure?
Below is the query that I have tried, but I got an error:
Msg 156, Level 15, State 1, Line 8
Incorrect syntax near the keyword 'IDENTITY'.
Code:
ALTER TABLE EMPLOYEE_DETAILS
ALTER COLUMN EMPLOYEE_ID IDENTITY(1,1);