为什么我的表名无效?
这是创建语句:
create table dbmonitor.DBMON_DATABASE_TYPE (
DATABASE_TYPE_ID BIGINT IDENTITY NOT NULL,
DispName NVARCHAR(255) null,
primary key (DATABASE_TYPE_ID)
)
这是我得到的错误:
13:40:57,685 ERROR [TestRunnerThread] SchemaExport [(null)]- The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 24,Table name = DBMON_DATABASE_TYPE ]
The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 24,Table name = DBMON_DATABASE_TYPE ]
Here is the create statement:
create table dbmonitor.DBMON_DATABASE_TYPE (
DATABASE_TYPE_ID BIGINT IDENTITY NOT NULL,
DispName NVARCHAR(255) null,
primary key (DATABASE_TYPE_ID)
)
and this is the error I get:
13:40:57,685 ERROR [TestRunnerThread] SchemaExport [(null)]- The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 24,Table name = DBMON_DATABASE_TYPE ]
The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 24,Table name = DBMON_DATABASE_TYPE ]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可能性:
dbmonitor
是您数据库的名称吗?您不能将.
放入表名称中。CREATE TABLE dbmonitor.dbo.DBMON_DATABASE_TYPE
吗?CREATE TABLE DBMON_DATABASE_TYPE
?Possibilities:
dbmonitor
the name of your database? You can't put a.
in a table name.CREATE TABLE dbmonitor.dbo.DBMON_DATABASE_TYPE
?CREATE TABLE DBMON_DATABASE_TYPE
?我不确定 dbmonitor 是否是一个架构名称,但根据 SQL CE 的文档 CREATE TABLE 语句中,不能在表名称中包含架构名称。
将 SQL Server 2005 Compact Edition(仅显示语句的初始部分)
与 SQL Server 2008 进行对比:
I'm not sure if
dbmonitor
is meant to be a schema name, but according to the documentation for the SQL CE CREATE TABLE statement, you cannot include a schema name with the table name.Contrast this for SQL Server 2005 Compact Edition (just showing the initial part of the statement),
with this for SQL Server 2008:
这可能不完全是这个问题标准的答案,但对于那些可能会遇到这里的人来说:
当您尝试将
EntityFramework.Extended
库与Sql Server CE.看来他们不兼容。
检查这些链接:
https://github.com/loresoft/EntityFramework.Extended/issues/35
https://github.com/loresoft/EntityFramework.Extended/issues/11
This may not be exactly an answer for this question's criteria , but for those who might get here :
this error can also happen when you try to use
EntityFramework.Extended
library withSql Server CE
. It seems that they are not compatible.check these links :
https://github.com/loresoft/EntityFramework.Extended/issues/35
https://github.com/loresoft/EntityFramework.Extended/issues/11