Insert Column

0 views
Skip to first unread message

Rohith

unread,
Nov 20, 2008, 12:45:38 AM11/20/08
to sqlalchemy
How to insert a column between two columns in MS SQL?
"Not in MYSQL"

eg: if in table ABC "a" and "b" are column and I want to insert "c"
column between "a" and "b" column.

One way to drop "b" column first then add "c" then again insert "b"
but that is not safe (if data not empty). Is there any Query in MS SQL
similar to MYSQL?

Empty

unread,
Nov 20, 2008, 9:11:55 AM11/20/08
to sqlal...@googlegroups.com
Hi
As far as I know you cannot purposefully order the columns through MSSQL except through the admin interface where you can drag them around.  The reason this works through the admin is that it's actually dropping and recreating the table and migrating the data from a temp spot.  You can see all this happening by scripting out the change before applying it.

I guess the real question is, why does matter?

Michael
Reply all
Reply to author
Forward
0 new messages