What is wrong with this SQL statement?

前端 未结 6 1025
夕颜
夕颜 2021-01-23 00:06

I\'m trying to create this table and I want to gauge my eyes out. What is wrong with it? I get an error: \"Incorrect syntax near PLAN\"

create table Instrumentos         


        
6条回答
  •  日久生厌
    2021-01-23 00:53

    PLAN is a reserved keyword. Depending on which SQL engine you are using, you will have to escape that column name using either quotations or brackets, ie:

    "Plan" bit
    

    Or

    [Plan] bit
    

    And also do so in any queries, ie:

    INSERT INTO Instrumentos(..., [Plan], ...) VALUES (...)
    

    Or:

    INSERT INTO Instrumentos(..., "Plan", ...) VALUES (...)
    

提交回复
热议问题