How to add New column in Required position
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Midhun TpRank #388 · 6.5K reputationPosted Aug 3, 2016, 1:37 AM EDT
Sanjeev Kumar55 reputationPosted Aug 3, 2016, 1:41 AM EDT
How to add New column in Required position in sql server
Joginder BangerRank #360 · 7K reputationPosted Aug 3, 2016, 1:44 AM EDT
You have to create a temp table that mirrors the original table's schema but with the column order that you want, then copy the contents of the original to temp. Delete the original and rename the temp.
This is what SQL Management Studio does behind the scenes.
With a schema sync tool, you can generate these scripts automatically.