Search code examples
sql-serverperformancedatabase-designsql-server-2016data-warehouse

SQL Server 2016: Change Column Order in Data Warehouse


Is there any option in SQL server 2016 to change column order still, without creating a temp table, and recreating/reinserting whole table? Link below is for 2005.

We have a 500 Million row table in data warehouse. We want to insert a column in the middle. Either we can recreate the table, or utilize 300+ views for all our tables, which have similar situation. The view becomes another meta data presentation layer we have to manage. Wish sql server is smart enough to change column orders easier like Aurora or Postgresql.

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


Solution

  • Is there any option in SQL server 2016 to change column order still, without creating a temp table, and recreating/reinserting whole table?

    No. Column ordinals in SQL Server control the visible order of the columns and the physical layout of the data.