Matt
Matt

Reputation: 13

SQL Error Alter Table?

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.

Upvotes: 1

Views: 1385

Answers (2)

Philip Kelley
Philip Kelley

Reputation: 40289

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

Upvotes: 2

Neil Knight
Neil Knight

Reputation: 48537

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

Upvotes: 6

Related Questions