Add a new column at a specific position column in MS SQL Server
There is no ALTER command or SQL query for adding a column after a particular column or position in SQL Server. You can do this with the help of SQL Server Management Studio.
Follow the following steps to add a new column at a particular position:
- Open the SQL SERVER MANAGEMENT STUDIO.
2. Connect the Database and go to the TOOLS –> Select Options.
3. On Left Panel, Expand the DESIGNER and select the TABLE AND DATABASE DESIGNERS. Now on Right Panel uncheck the option PREVENT SAVING CHANGES THAT REQUIRE TABLE RE-CREATION and click OK.
4. Go to the object explorer, and select the table on which we need to add a new column at a particular position.
5. Right-click where you want to insert the new column.
6. Added column in the table as shown below and save with CTRL+S key.
Why can this not be automated in an SQL script using AFTER? Need a different DB provider that understands the importance of scripting in database maintenence.