Click here to Skip to main content
15,897,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to insert a column in between 2 columns of the table using alter statement.

i should not use drop the table or create a new table.
i should use only alter statement to enter a column in between two columns
Posted

You cannot do this. Dropping the columns (or the table) and recreating is the only option to put a column in between two other columns.
 
Share this answer
 
you can not add column between two column in sql server

when you add column it will added at last position by-default
drop table and recreate it if column position is important

but in select statement you can arrange columns
also in insert statement too, if you have write insert query like this
insert into tbl(Columns' list) values(value list)

not like this
insert into tbl select 1 as col1,...


Happy Coding!
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900