该模型已经有一个名为dbo.tablename的元素

时间:2016-06-03 13:37:02

标签: c# visual-studio server-explorer

我在服务器资源管理器中创建了一个包含以下查询的表:

CREATE TABLE monitoring
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
[brandname_id] INT NULL, 
[module_id] INT NULL, 
[frequency_id] INT NULL, 
[succ_count] INT NULL, 
[failCalib_count] INT NULL, 
[failWriteFlash_count] INT NULL, 
[failEraseDevice_count] INT NULL, 
[failWriteAVR_count] INT NULL, 
[programmingLocation] INT NULL, 
[dateonly] DATE NULL
)

然后我删除了数据库,这个表并尝试使用相同的数据库名称和表查询再次重新创建它们。单击表设计器中的“更新”按钮后,我收到以下消息:

Update cannot proceed due to validation errors.  
Please correct the following errors and try again.

SQL71508 :: The model already has an element that has the same name dbo.monitoring.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.Id.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.brandname_id.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.module_id.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.frequency_id.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.succ_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.failCalib_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.failWriteFlash_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.failEraseDevice_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.failWriteAVR_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.programmingLocation.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.dateonly.
SQL71501 :: Default Constraint: [dbo].[CONSTRAINT_NAME] has an unresolved reference to object [dbo].[monitoring].
SQL71501 :: Default Constraint: [dbo].[CONSTRAINT_NAME] has an unresolved reference to Column [dbo].[monitoring].[dateonly].
SQL71501 :: Primary Key: unnamed constraint on [dbo].[monitoring] has an unresolved reference to object [dbo].[monitoring].
SQL71501 :: SqlIndexedColumnSpecification: <unnamed> has an unresolved reference to Column [dbo].[monitoring].[Id].
SQL71508 :: The model already has an element that has the same name dbo.monitoring.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.Id.
SQL71501 :: Primary Key: unnamed constraint on [dbo].[monitoring] has an unresolved reference to object [dbo].[monitoring].
SQL71501 :: SqlIndexedColumnSpecification: <unnamed> has an unresolved reference to Column [dbo].[monitoring].[Id].
SQL71508 :: The model already has an element that has the same name dbo.monitoring.brandname_id.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.module_id.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.frequency_id.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.succ_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.failCalib_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.failWriteFlash_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.failEraseDevice_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.failWriteAVR_count.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.programmingLocation.
SQL71508 :: The model already has an element that has the same name dbo.monitoring.dateonly.

我假设某些临时文件未被清除,因此它认为该表仍然存在。有人知道解决方案吗?感谢。

0 个答案:

没有答案