Simple RENAME using SQL

godmac

New member
Local time
Yesterday, 23:24
Joined
Jul 23, 2007
Messages
2
Hi guys,

I know this is pretty basic stuff but I MS Access is not my strong point.

I am looking to simply rename a table in MS Access 2003 using SQL, can anyone please help ?

There are no reports or queries attached to it.

Am I right in saying RENAME is not a reserved word in MS Access ?

Thanks.
 
This is not an SQL function. It is a DDL function. Look up DDL in Access Help.

RENAME is not a reserved word.
 
I'm not sure there is any a simple "rename table" command for DLL. You'll either have to create the table, then append the old data, or use some SELECT INTO syntax (in the interface, that's probably called a "Make Table query") and then drop the old table. If there's relationship, you'll have to deal with that too.

Is there any reason you think you have to use DDL? If you can't simply rename in the interface, what about going through the TableDefs collection of the Database object?

CurrentDB.TableDefs("MyTable").Name = "TheNewName"
 
I believe DDL allows an ALTER TABLE that would include renaming the table as one of the possiblities. But sometimes I get confused by what JET allows and what ORACLE allows. So Roy, if I blew that one, thanks.

And you are ABSOLUTELY right that you would do better to muck this via programs through the collections interface. But I was trying to answer the question as closely as possible within its original intent, an SQL-like syntax as opposed to a VBA or GUI syntax.

godmac, I still advise you to look up DDL. But if you cannot find the syntax you want in Access Help on DDL, what you want as you asked it might not exist. Roy seems to think it doesn't. So heck, look it up for yourself and see what you CAN do.
 
Thanks Guys,

I will take a look at this.

Once again, thanks for taking the time to reply, it's much appreicated.

Incidentally, does anyone know where the Sopra graphic comes from ? I work for them and I know I didn't do it !!!

G.
 

Users who are viewing this thread

Back
Top Bottom