# Related Sites > SQL Course >  Change a table name

## rossifumi

How do you change a table name, say from APPLES to PEARS ?

Many thanks

----------


## MAK

create table apples(id int)
sp_rename apples,pineapple

----------


## rossifumi

Cheers MAK for your reply, but I can't get that to work.  I've got the table APPLES already setup but I can't change the name of the table.

----------


## MAK

why not? what error message you are getting?

do u have dbo access or db_ddladmin access?


BTW.. r u using sql server 2000?

----------


## rossifumi

I'm new to this, I'm using Oracle SQL Plus

----------


## MAK

rename table_name2 to table_name1;

----------


## jkoopmann

for Oracle you can rename a table by:
ALTER TABLE table_name2 RENAME TO table_name1;

----------


## rossifumi

Many thanks! excellent. Can you change a column name in Oracle do you know ?

----------


## jkoopmann

yes,
example:
ALTER TABLE table_name
   RENAME COLUMN column_name1 TO column_name2;

----------


## rossifumi

I'm afraid I can't get this to work in Oracle any ideas ?

Cheers

Rich

----------


## jkoopmann

more than likely version / permissions.
what error are you getting.
what version or oracle are you using.

----------

