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

Salman BegPosted Jan 20, 2019, 9:38 AM
Sourav MukherjeePosted Jan 19, 2019, 8:15 AM
Thiyagarajan EPosted Jan 17, 2019, 6:24 AM
Vinay Kumar DaraPosted Jan 17, 2019, 3:35 AM
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.
Madan ShekarPosted Jan 17, 2019, 3:26 AM
Sreekanth ReddyPosted Jan 17, 2019, 3:17 AM