How to change column order in a table using sql query in sql server 2005?

You cannot. The column order is just a “cosmetic” thing we humans care about – to SQL Server, it’s almost always absolutely irrelevant.

What SQL Server Management Studio does in the background when you change column order there is recreating the table from scratch with a new CREATE TABLE command, copying over the data from the old table, and then dropping it.

There is no SQL command to define the column ordering.

Leave a Comment