Changing column names in Access 2003 SQL
Changing column names in Access 2003 SQL
(OP)
Hello,
Using Access 2003. I have an existing table and am trying to rename a column to a new name. I know I have to use the ALTER TABLE statement, but then I am not sure how to rename the column. All the references I have show difference "dialects" to rename.
Wondering if anybody can help.
Thank you.
Using Access 2003. I have an existing table and am trying to rename a column to a new name. I know I have to use the ALTER TABLE statement, but then I am not sure how to rename the column. All the references I have show difference "dialects" to rename.
Wondering if anybody can help.
Thank you.
RE: Changing column names in Access 2003 SQL
To rename in SQL, I think you'll need to add a new column with tthe name you want, update that column with the value from the old column, then drop the old column.
Maybe you can play with TableDef in VBA to do the renaming?
RE: Changing column names in Access 2003 SQL
CODE
UPDATE myTable SET NewColumn = OldColumn
ALTER TABLE myTable DROP COLUMN OldColumn
RE: Changing column names in Access 2003 SQL