Can I logically reorder columns in a table?

后端 未结 8 1531
抹茶落季
抹茶落季 2020-12-15 02:04

If I\'m adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries?

I don\'t want to mess with the physical

8条回答
  •  执笔经年
    2020-12-15 02:54

    If I understand your question, you want to affect what columns are returned first, second, third, etc in existing queries, right?

    If all of your queries are written with SELECT * FROM TABLE - then they will show up in the output as they are laid out in SQL.

    If your queries are written with SELECT Field1, Field2 FROM TABLE - then the order they are laid out in SQL does not matter.

提交回复
热议问题