为什么在解析此DDL时出错,为什么引擎不能更具体地定位它? [英] Why is there an err parsing this DDL, and why can't the engine be more specific about locating it?
问题描述
使用此DDL("BLA"是表名,格式为"CCR130329093342")
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.
此DDL明显有什么问题吗?应该是这样吗?
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
?
如果我将DDL恢复为原始的简单类型(不添加"NOT NULL",则简单地"alter bla add blah nvarchar(12)"),我不会收到无法解析查询"的消息.msg 除了中声明了浮点数的代码(如上所示)...对浮点数有SQL-Server-CE讨厌,或者... ???
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...???
推荐答案
默认值需要一个值:
alter table bla add salvation float not null with default(0.0)
这篇关于为什么在解析此DDL时出错,为什么引擎不能更具体地定位它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!