English

Error: Column name is an SQL keyword, and hence not a legal column name

Error Message

When importing data into an ArcSDE geodatabase using administration commands, such as shp2sde, cov2sde, or tbl2sde, if the input data contains a column name that is the same as an SQL reserved keyword, an error is returned similar to the following:

'<name>' is an SQL keyword, and hence not a legal column name.
Error converting shapefile attribute column into SDE.

Additionally, if the data being imported to the ArcSDE geodatabase has a table name that is the same as a SQL reserved keyword, an error is returned.

Cause

Database Management Systems (DBMS) maintain a set of keywords that are reserved for use as commands to define, alter, or access the database. Using these words for purposes other than these, in this case using the keywords for table or column names, is not allowed.

The list of keywords may vary from system to system. Consult your DBMS documentation to identify the reserved keywords.

Solution or Workaround

Import the data using ArcCatalog rather than using the ArcSDE administration commands. When importing data to an ArcSDE geodatabase using ArcCatalog, ArcCatalog appends an underscore to any column or table names that are reserved keywords.

For example, if importing a shapefile that has a column named COMMENT, ArcCatalog renames the column COMMENT_.