Renaming a column in ms access!

Hello!
I hope this is the right forum :) I'm creating a multi database interface tool but I have stumbled across a problem I didnt forsee - renaming a column.
After doing SQL in Oracle for so long I didnt assume this would be a problem, but in access it seems to be! For the life of me I cannot find out how to do this in Visual C#.net!
Adding or dropping a column is very easy: write the correct SQL and execute it.... It seems however there isnt an SQL to rename the column.

Can anyone point me in the right direction on how to do this please

Thanks in advance....


Answer this question

Renaming a column in ms access!

  • Lee_Dale

    Not 100% straightforward, but doable in SQL:

    create table sss (id int)

    alter table sss add column idnew int

    update sss set idnew = id

    alter table sss drop column id

  • stevejn

    Hello.
    That seems to work, but only to some extent. For example the column ordinal is obviously different (as at a given moment in time both columns are in "alive").
    This is the best / only method I have seen working for access (all other databases seem to have a rename column function).... but still I think this method doesnt seem to "replicate" the column fully.

    Thanks for the input... as I said this is by far the best method ive seen on the net so far.... but surely there is a better way

  • Renaming a column in ms access!