Insert a new column in between two columns in SQL Table

Hello Experts,
In a SQL table, is there a way to insert a new column in between two columns?  I don't like to add it at the end.

Thank you very much in advance!
RadhaKrishnaKiJayaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Russ SuterCommented:
Using SSMS, yes although behind the scenes it's actually dropping and recreating things. Strictly using query syntax, no it's not possible. You'd have to create a copy of the table with the columns in the order you want then transfer the data from the old table to the new one then drop the old table.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Russ SuterCommented:
Using SSMS, right click on the table and choose "Design" from the context menu. Next, select the column where you want to insert the new column and right click. Choose "Insert Column" from that context menu. Name the column, set its data type and whether or not you want to allow null values. Save the table and there you go.
Image-1.png
1
Vitor MontalvãoMSSQL Senior EngineerCommented:
Columns are always inserted at the end of the column list by default.
Anyway, why the physical order of the columns matters to you?
You can always present the results in the order you want by providing the column names in the SELECT command. Example:
SELECT Column1, Column4, Column2, Column3
FROM TableName

Open in new window

0
RadhaKrishnaKiJayaAuthor Commented:
Thank you Russ Suter and Vitor Montalvão.  Your comments are very helpful.  Thank you again!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.