Skip to content
Advertisement

I am trying to create a table in SQL and keep getting an error

I’m using Teradata SQL assistant to create a table. The code I am using is as follows:

I get this error when I try to execute the command:

[Teradata Database] [3707] Syntax error, expected something like a ‘CHECK’ keyword between ‘,’ and the ‘Month’ keyword.

Does anyone know what the issue is?

Advertisement

Answer

As the error implies month (and year, too) is a reserved keyword in Teradata, which can’t be used as column name.

You might double quote it (but then you have to double quote it in every query, too) or you change the name. There’s another issue, a missing comma before the primary key constraint:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement