Visual Studio 数据生成计划架构更新
我是 Visual Studio 中的数据生成计划的新手,但我用 google 搜索了一下,找不到这个问题的答案。 我已经根据数据生成计划(由于字段太大而导致过程中断)生成的数据对数据库端的架构进行了修改(更改了 NVARCHAR 字段的大小),现在我想生成基于新模式的新数据。
有什么方法可以从数据库中重新导入架构或使其始终保持活动和连接吗?
我知道我可以在生成计划内切换字段大小,但这是一个简单的情况稍后会变得更复杂。
I'm new to Data Generation Plans in Visual Studio, but I googled a bit and can't find the answer to this question. I've made modifications to my schema on the database side (changed the size of an NVARCHAR field) based on data that was generated by a Data Generation Plan (a procedure broke because the field was too large), and now I want to generate new data based on the new schema.
Is there any way to re-import the schema from the database or to keep it live and connected at all times?
I know I can just switch the field size inside of the generation plan, but this is a simple case of something that will be more complicated later on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用模式比较(文件菜单:数据 > 模式比较 > 新模式比较)同步项目和数据库模式。 之后,如果您打开数据生成计划,它应该要求您刷新它。
Use Schema Compare (File menu: Data > Schema Compare > New Schema Comparison) to synchronize project and database schema. After that if you open Data Generation Plan it should ask you to refresh it.
如果您的架构发生更改,IDE 不会强制您更新数据生成计划吗?
来自 MSDN:
更多证据来自博客这个主题:
我想您可以深入研究 *.dgen 文件并执行预构建步骤(或类似的步骤),以确保它始终与您的数据库架构匹配。 也许这足以使事情自动化。
Doesn't the IDE force you to update your data generation plan if your schema changes anyway?
From the MSDN:
More evidence from a blog on this subject:
I guess you could dig into the *.dgen file and do a pre-build step (or something similar) that would ensure it always matches your DB schema. Maybe that would automate things enough.