当我进行数据库更改时,如何知道需要删除哪些内容并将其读入Visual Studio中的LinqToSql O/R设计器? [英] When I make a database change, how do I know what needs to be removed and readded to the LinqToSql O/R Designer in Visual Studio?

查看:95
本文介绍了当我进行数据库更改时,如何知道需要删除哪些内容并将其读入Visual Studio中的LinqToSql O/R设计器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我将表中的列从null更改为非null.

For example, I alter a column in a table to be not null from null.

然后我需要删除并读取表.那部分很清楚.

I need to then delete and readd the table. That part is pretty clear.

访问表(尤其是表中的该列)的视图,函数和存储过程如何?

What about views, functions, and stored procedures that access the table, especially that column in the table?

我已经尝试对SQLMetal生成的文件运行diff,但取得的成功有限,但是即使如此,它仍然不清楚.

I've tried running diffs against the files generated by SQLMetal with some limited success, but even with that it's fairly unclear.

我知道至少有一种商业工具可以解决这个问题,但是我正在寻找免费的工具.

I know there is at least one commercial tool out there that claims to address this problem, but I am looking for something free.

人们如何处理这个问题?

How are people dealing with this issue?

推荐答案

似乎您正在将大量业务逻辑放入SQL DB中,而不是将其保留在应用程序本身中.尝试采用更多的 DDD 模型-这应该将SP和View的大部分工作从db正在恢复它们所属的应用程序.然后,您的数据库仅应用于持久存储数据,因此更改为表只需在L2S设计器中花费很少的时间进行更新即可.

It seems you are putting a lot of business logic into your SQL DB rather than keeping it in the app itself. Try adopting a more DDD approach with a Domain Model - this should move much of the work those SPs and Views from the db are doing back into the application where they belong. Then your db should only be for persisting data and hence changed to tables should only require a very small amount of time in the L2S designer to make updates.

这篇关于当我进行数据库更改时,如何知道需要删除哪些内容并将其读入Visual Studio中的LinqToSql O/R设计器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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