Hi Friends,
following are the ex:-
1) I have a Table with 15 Column.
like (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
i want a select query with column position change like
10,1,2,3,4,5,6,7,8,9,11,12,13,14,15
and i dont want to use each column name to use in query


Sreekanth ReddyRank #726 · 3.2K reputationPosted Jan 16, 2019, 10:17 PM EST
Madan ShekarRank #428 · 5.9K reputationPosted Jan 16, 2019, 10:26 PM EST
Vinay Kumar Dara41 reputationPosted Jan 16, 2019, 10:35 PM EST
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 TABLEcommand, copying over the data from the old table, and then dropping it.There is no SQL command to define the column ordering.
Thiyagarajan ERank #2,329 · 607 reputationPosted Jan 17, 2019, 1:24 AM EST
Sourav MukherjeeRank #850 · 2.6K reputationPosted Jan 19, 2019, 3:15 AM EST
Salman BegRank #284 · 8.8K reputationPosted Jan 20, 2019, 4:38 AM EST