I have a table like below format.

CREATE TABLE Customer (
  number VARCHAR(40)  NOT NULL, --col 1 
  name   VARCHAR(100) NOT NULL, --col 2
  ssn    VARCHAR(50)  NOT NULL, --col 3
  age    INTEGER      NOT NULL, --col 4
)

I want to add a new column in the table. If I using the below command I got the ‘NewColumn’ as ‘col 5’.

ALTER TABLE Customer ADD NewColumn INTEGER

How to add the ‘NewColumn’ as ‘column 3’ ?

Any help appreciated,

Thanks,
Mani Muthu

As far as I understand MSSQL does not support this. You'd have to drop and recreate the table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.