views:

55

answers:

2

I have been trying to add columns to a table using some logic that produces this statement:

ALTER TABLE Master_List 
  ADD COLUMN Service VARCHAR(100) , 
             Vendor VARCHAR(100) , 
             Product VARCHAR(100) , 
             Service_Description VARCHAR(100) , 
             Level/Scale VARCHAR(100) , 
             SunGard_Contract_Schedule_ID VARCHAR(100) , 
             Application_Owner VARCHAR(100) , 
             Application_Servers VARCHAR(100) , 
             Required_Support/Dependencies VARCHAR(100);

whenever I have been trying to run it I continually get this error:

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition. at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957) at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114) at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3110) at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338) at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:288) at Testing.main(Testing.java:54)

I have been checking online for the proper format for the ALTER TABLE command, and the formatting seems to be correct, I have tried changing so many things I have run out of ideas of how to fix it....

The table name is Master_List, and none of those columns already exist inside it.

This is being used inside Java, incase that is relevant.

+12  A: 

It could be the / in your column names that is giving you the problem

Ardman
Thanks, seems that was it. Still new to SQL and unsure what kind of things can be inside column names. Figured since _ was alright that / would be fine too. Thanks!
Matt
You can accept this as the correct answer by clicking the tick beside it :)
ChrisCM
+1  A: 

Your column names contain the "/" character, and that is not a valid character for column names.

Philip Kelley