| Author |
Topic |
|
senthil.dhaktchana
Starting Member
3 Posts |
Posted - 2008-07-25 : 08:19:22
|
| hi,i have a table with two columns namely empid,empname ..now i need to add the new column between empid and empname columns..if i try to add the column by using alter table command , it will be added next to the empname..but i need to add between two columns ..how can i do it?regardssenthil |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-25 : 08:21:05
|
why does it has to be added in between ? the order of column is not important KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-07-25 : 08:27:27
|
| You will need to export data to table with different name and change your column as you like with data imported back again. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-25 : 08:38:25
|
| Ordinal position of the column doesnt matter as long as you have it in the proper place at the SELECT statementMadhivananFailing to plan is Planning to fail |
 |
|
|
VGuyz
Posting Yak Master
121 Posts |
Posted - 2008-07-25 : 09:08:53
|
| I think this column alignment will not become a issue.If u want to show the column of u'r table like belowempid,new_column,empnamemeans do it with the query likeselect empid,new_column,empname from table_name |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-25 : 09:15:16
|
quote: Originally posted by VGuyz I think this column alignment will not become a issue.If u want to show the column of u'r table like belowempid,new_column,empnamemeans do it with the query likeselect empid,new_column,empname from table_name
Exactly what I have described MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-25 : 10:37:09
|
quote: Originally posted by madhivanan Ordinal position of the column doesnt matter as long as you have it in the proper place at the SELECT statementMadhivananFailing to plan is Planning to fail
How many times have we told this before |
 |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2008-07-25 : 10:43:16
|
| but just to make it look pretty you can do it from the SQL Server Management Console. Right click on table name and then click Design. Drag and place your column where ever you want. |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-07-25 : 14:15:02
|
quote: Originally posted by rohitkumar but just to make it look pretty you can do it from the SQL Server Management Console. Right click on table name and then click Design. Drag and place your column where ever you want.
What?????? Try it and reply.You can't change from design unless you don't have any data . |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-07-25 : 14:16:29
|
quote: Originally posted by visakh16
quote: Originally posted by madhivanan Ordinal position of the column doesnt matter as long as you have it in the proper place at the SELECT statementMadhivananFailing to plan is Planning to fail
How many times have we told this before 
I don't like to say but there are so many twit like this in SQL 2005 administration as well. |
 |
|
|
|