Making SQL updates to a table named 'COLUMN'

S

Stevio

I have a table called COLUMN (not a good name I know).

Insert into and delete from SQL statements work fine with the table,
however, when I try to add a column to the table using the following code:
"ALTER TABLE COLUMN ADD IS_DEFAULT YESNO NOT NULL"
I get the following error;
"[Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE
statement."

Is there a way of doing this in SQL for this table called COLUMN?

Alternatively, can I use an SQL statement to rename the table?

The statement "RENAME TABLE COLUMN TO ACOLUMN" gives the error:
"Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'."

Thanks,
Stephen
 
M

Michel Walsh

Hi,


With Jet, we use [ ] around the illegal name, with MS SQL Server, by
default, use " " around the illegal field name.

ALTER TABLE "Column" ADD ...



Hoping it may help,
Vanderghast, Access MVP
 
S

Stevio

Thanks Michel,

Using " " worked great. Do you know what the SQL statement is to rename a
table in Access?

Using rename table does not seem to work, even with " ".

Stephen

With Jet, we use [ ] around the illegal name, with MS SQL Server, by
default, use " " around the illegal field name.

ALTER TABLE "Column" ADD ...

Stevio said:
I have a table called COLUMN (not a good name I know).

Insert into and delete from SQL statements work fine with the table,
however, when I try to add a column to the table using the following
code:
"ALTER TABLE COLUMN ADD IS_DEFAULT YESNO NOT NULL"
I get the following error;
"[Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE
statement."

Is there a way of doing this in SQL for this table called COLUMN?

Alternatively, can I use an SQL statement to rename the table?

The statement "RENAME TABLE COLUMN TO ACOLUMN" gives the error:
"Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
'SELECT', or 'UPDATE'."

Thanks,
Stephen
 
M

Michel Walsh

Hi,


There is no RENAME in JET. You can create a new column, transfer the
data, and drop the initial one.

Hoping it may help,
Vanderghast, Access MVP


Stevio said:
Thanks Michel,

Using " " worked great. Do you know what the SQL statement is to rename a
table in Access?

Using rename table does not seem to work, even with " ".

Stephen

With Jet, we use [ ] around the illegal name, with MS SQL Server, by
default, use " " around the illegal field name.

ALTER TABLE "Column" ADD ...

Stevio said:
I have a table called COLUMN (not a good name I know).

Insert into and delete from SQL statements work fine with the table,
however, when I try to add a column to the table using the following
code:
"ALTER TABLE COLUMN ADD IS_DEFAULT YESNO NOT NULL"
I get the following error;
"[Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE
statement."

Is there a way of doing this in SQL for this table called COLUMN?

Alternatively, can I use an SQL statement to rename the table?

The statement "RENAME TABLE COLUMN TO ACOLUMN" gives the error:
"Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
'SELECT', or 'UPDATE'."

Thanks,
Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top