alter table add column at specific position in sql server

52 Points
16 Posts

Is it possible to add a column to a table at a specific ordinal position in SQL Server?

For instance, our tables always have CreatedDate, CreatedBy, LastModifiedDate, LastModifiedBy columns at the "end" of each table definition? I'd like the new column to show up in SSMS above these columns.

Views: 8274
Total Answered: 1
Total Marked As Answer: 1
Posted On: 11-Jun-2017 21:50

Share:   fb twitter linkedin
Rahul Maurya
Rahul M...
1170 Points
210 Posts
Marked as answer      

Unfortunately you can't.

If you really want them in that order you'll have to create a new table with the columns in that order and copy data. Or rename columns etc. There is no easy way.

Posted On: 13-Jun-2017 22:19


Active User (2)

 Log In to Chat