views:

163

answers:

2

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?

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?

A: 

+1 on the question.

But what's bad about using a commercial tool if it solves the problem? After all, if you spend an hour per week on manually matching up changes instead of hitting a button that does it all for you, then the license cost of using a commercial tool will pay itself back in no time at all. All tools that address this issue cost a fraction of a Visual Studio license, have free trials, and the price is not more than an hour of work for most devs. Just my 2 cents.

That said, I agree it would be neat if this functionality was available for free. I have tried suggesting that to MSFT many times but they don't seem to be interested in that. (as in: they don't even reply back... :) )

KristoferA - Huagati.com
For whatever reason, many projects I'm on can afford $100/hr contractors, but they can't afford to buy *any* software, components, tools, or anything else (due to how the corporate budgets are setup or whatever other lame reason). This makes things like LinqToSql appealing since it's free and out of the box. I can't justify the budget shenanigans that occur at these companies, I can only try to work around them. With regards to LinqToSql, I'm still waiting to find a free tool to do this. In the meantime, I'm moving toward NHibernate as a solution.
Michael Maddox
Ah, that brings up an interesting issue that I have seen traces of 'from the outside'. I think it is most common with big companies - the bureacrazy (intentional misspelling :) ) is so complicated so devs can't get the tools they need without spending hours filling out forms etc. It would be neat to see some reseller solution (e.g. a 'toolbelt' package where devs can pick their own tools/components from a wide set of suppliers for up to a predetermined amount $x/dev/year, or sometihng...).
KristoferA - Huagati.com
A: 

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.

cottsak
In general, I agree about not putting business logic into the database through stored procedures, etc. However, that doesn't mean it's always the right decision or that it's always possible. For the purposes of this question, please assume that moving the business logic out of the database isn't an option.
Michael Maddox
Then as far as i can see you will need to remove/add the respective entities (db objects that are modified by ur table change) in your dbml file using the designer every time. i do this a lot - usually it's not a big deal. if for some reason ur NULL to NOT NULL change means you will need to spend >1hr updating dbml then all i can say is good luck.
cottsak
i heard in VS2010 that there might be an auto-sync feature for the dbml designers
cottsak