dbTalk Databases Forums  

RENAME Column

comp.databases.ms-access comp.databases.ms-access


Discuss RENAME Column in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bubbles
 
Posts: n/a

Default RENAME Column - 04-04-2010 , 10:56 PM






Is there an Access SQL function to rename a column?

I tried the following:
ALTER TABLE tablename RENAME oldcolumn newcolumn;

ALTER TABLE tablename REN oldcolumn newcolumn;

ALTER TABLE tablename RN oldcolumn newcolumn;

all do not work.

Checked the Access SQL reference - found no reference to renaming
columns.
Any ideas?

Reply With Quote
  #2  
Old   
Tom van Stiphout
 
Posts: n/a

Default Re: RENAME Column - 04-04-2010 , 11:14 PM






On Sun, 4 Apr 2010 20:56:57 -0700 (PDT), bubbles
<bubbles.one (AT) hotmail (DOT) com> wrote:

Perhaps you can use three statements: one using the ADD COLUMN clause,
one using an UPDATE statement to copy the data over, and one using the
DROP COLUMN clause.

-Tom.
Microsoft Access MVP


Quote:
Is there an Access SQL function to rename a column?

I tried the following:
ALTER TABLE tablename RENAME oldcolumn newcolumn;

ALTER TABLE tablename REN oldcolumn newcolumn;

ALTER TABLE tablename RN oldcolumn newcolumn;

all do not work.

Checked the Access SQL reference - found no reference to renaming
columns.
Any ideas?

Reply With Quote
  #3  
Old   
bubbles
 
Posts: n/a

Default Re: RENAME Column - 04-07-2010 , 03:17 AM



Thank you, Tom. That was what I did.
I am surprised that this action is not supported in Access SQL.



On Apr 5, 12:14*pm, Tom van Stiphout <tom7744.no.s... (AT) cox (DOT) net> wrote:
Quote:
On Sun, 4 Apr 2010 20:56:57 -0700 (PDT), bubbles

bubbles.... (AT) hotmail (DOT) com> wrote:

Perhaps you can use three statements: one using the ADD COLUMN clause,
one using an UPDATE statement to copy the data over, and one using the
DROP COLUMN clause.

-Tom.
Microsoft Access MVP

Is there an Access SQL function to rename a column?

I tried the following:
ALTER TABLE tablename RENAME oldcolumn newcolumn;

ALTER TABLE tablename REN oldcolumn newcolumn;

ALTER TABLE tablename RN oldcolumn newcolumn;

all do not work.

Checked the Access SQL reference - found no reference to renaming
columns.
Any ideas?

Reply With Quote
  #4  
Old   
Marco Pagliero
 
Posts: n/a

Default Re: RENAME Column - 04-07-2010 , 06:34 AM



On 7 Apr., 10:17, bubbles wrote:
Quote:
Thank you, Tom. That was what I did.
I am surprised that this action is not supported in Access SQL.
Yes, MySql and Oracle can this, SQL-Server has sp_rename (
http://databases.aspfaq.com/database...-a-column.html ),
Access cannot.

Maybe they wonted to protect us against ourselves, as renaming a
column can break joins. But then it is easy to rename columns in VB.
Who knows?

Greetings
Marco P

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.