Why is there an err parsing this DDL, and why can't the engine be more specific about locating it?

白昼怎懂夜的黑 提交于 2019-12-12 05:26:53

问题


With this DDL ("BLA" is a tablename in the form "CCR130329093342")

ALTER TABLE BLA ADD salvation float NOT NULL WITH DEFAULT

...I'm getting, "There was an error parsing the query. [Token line number, Token line offset,, Token in error,,]"

Okay, then, which line number? offset? It knows/thinks there's a problem, but can't or won't say what or where.

Is there anything obviously wrong with this DDL? Should it be this instead:

ALTER TABLE BLA ADD salvation float NOT NULL WITH DEFAULT 0.0

?

UPDATE

If I revert the DDL back to the original simple type (without adding "NOT NULL", simply "alter bla add blah nvarchar(12)" I don't get the "query could not be parsed" msg except in the one that declares a float (shown above)...does SQL-Server-CE hate on floats, or...???


回答1:


default needs a value:

alter table bla add salvation float not null with default(0.0)


来源:https://stackoverflow.com/questions/15707487/why-is-there-an-err-parsing-this-ddl-and-why-cant-the-engine-be-more-specific

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!