How to Change Ordinal position in sql server Table

Posted by Jayakumars under Sql Server on 3/26/2013 | Points: 10 | Views : 2963 | Status : [Member] [MVP] | Replies : 2
hi

How to Change Ordinal position in sql server Table after creation table structure.

Mark as Answer if its helpful to you


Responses

Posted by: Jitendrasoft09 on: 3/27/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
While selecting the query we can change the order of column of the table as below mentioned-

select column4, column2, column1, column3, column5 from table_name;

If you want to change the order of column on the table, then we can create new table with change of order of the column for the table.

create table new_table_name as ( select column4, column1, ... column_n from old_table_name);



Jitendra Kumar
If my post helps you, plz mark as an answer.

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prateekagra on: 3/29/2013 [Member] Starter | Points: 25

Up
0
Down
if you wish to change in the existing table then you can do it from designed interface of table .simply drag and drop the column according to your order.

but this is not suggested as it will impact the object id of columns

it better to create another table as per your requirement

Prateek Agarwal
DBA

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response