SQL中的默认值 [英] Default Values in SQL

查看:185
本文介绍了SQL中的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS2010 Beta 2(来自MSDN的最新版本)。

我正在测试实体框架,看起来很有趣。

我去过尝试进行实体拆分,但由于默认值错误3023而无法执行此操作。

为了试图找出问题,我只是通过从SQL中选择一个表来创建模型。 />
当我从模型中删除其中一个属性,并尝试编译时失败并显示错误3023.

我读了另一篇声称模型未读取默认值的帖子一栏。

这对我来说是一个交易破坏者,因为我不想在模型中设置默认值。

是否有可行的选择,是未来计划解决这个问题?

罗素曼格尔在内华达州拉斯维加斯

Hi, I am using VS2010 Beta 2 (Latest Version from MSDN).

I am testing the Entity Framework, looks interesting.

I have been trying to do Entity Splitting, but unable to do so because of Default Values Error 3023.

In order to try to figure out the problem, I just created a Model by choosing one Table from SQL.

When I delete one of the properties from the Model, and try to compile it fails with Error 3023.

I read another post that claims the Model does not read the Default Values on a column.

This is a deal breaker for me, as I don't want to set defaults in the Model.

Is there a workable alternative, and are the future plans to fix this?

Russell Mangel
Las Vegas, NV

推荐答案

Hello Russell,

欢迎使用ADO.NET实体框架和LINQ to Entities论坛!

由于您使用的是VS2010 Beta 2,因此EF版本应为EF 4 CTP1或CTP2。 我将此线程移至ADO.NET Entity Framework(预发行版) )更好的支持论坛。 许多EF产品团队成员正在帮助那里的预发布用户。

Since you are using VS2010 Beta 2, the EF version should be EF 4 CTP1 or CTP2.   I will move this thread to ADO.NET Entity Framework (Pre-release) forum for better support.  Many EF product team members are helping the pre-release users there.  

目前,为此问题,最好的解决方法是在EDM侧定义默认值。 您能否告诉我们为什么您不能在模型级别设置默认值?

Currently, for this problem, the best workaround would be to define the default value at the EDM side.  Could you please tell us why you cannot set the default value at the model level?  

< span style ="font-family:Calibri">

如果您有任何疑问,请随时告诉我。

祝你有愉快的一天!

最诚挚的问候,郎灵芝

MSDN订阅者支持

如果您对我们的支持有任何反馈,请联系 msdnmg@microsoft.com


这篇关于SQL中的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆