Link to home
Start Free TrialLog in
Avatar of dshi15
dshi15Flag for United States of America

asked on

how to add a column in certain positon in table?

Hi Expert,

How I can add a cloumn to a exist table in certain position for instance,

Table 1

FirstName varchar(20), Lastname varchar(20).

I want add a column MiddleName varchar(20) in second column and all data can not be lost.

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of DVation191
DVation191

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dshi15

ASKER

I need use sql statement, not design view. Could some one write sql statement? How to recreate?

thanks,
You gonna need to post the table structure first.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I Agree.
>>Could some one write sql statement? How to recreate?<<
If you persist and in case you missed the point, here it goes again:
Use SSMS to make the change but do not save instead copy the script generated and use that in your code.