Note that there are some explanatory texts on larger screens.

plurals
  1. POCalling all database/ ORM/ data access layer experts
    text
    copied!<p>I have a little DB challenge for you. Hopefully you can help.</p> <h2>The Problem:</h2> <p>I need a solution that will allows me to "handle" changes to primary keys/ composite keys. By "handle", I mean I should still be able to perform CRUD operations with little or no code changes. It needs to have minimum hassle from an application/ database point of view. </p> <p>I am allowed to use pretty much anything under the sun except for the 2 constraints as follows: 1) Need to use SQL Server 2) Not allowed to use dynamic SQL queries </p> <h2>My initial brainstorm/ Possible Solutions?</h2> <p>a) Can it be solved at stored procedure level somehow?</p> <p>b) Can some sort of clever use of DTO with adapter pattern/ reflection/ DB schema interrogation solve this?</p> <p>c) Some sort of fancy LINQ/ reflection trick?</p> <p>d) Can NHibernate solve this somehow?</p> <p>I am under a bit of time pressure (I have to come up with a solution before the end of the week) so any help will be appreciated. So, here it is. If you think you might have a solution but could not be bothered using any brain cells, here is an incentive (hopefully it will work)...if your solution solves the problem for me and I end up using it, you get fully licensed commercial (not pirated :P ) version of any Microsoft software of your choosing eg. Windows 7, SQL Server, Office 2007, etc. If the incentive does not work, I hope you'll help me anyways? :-) Kind of desperate here :-)</p> <p>Thank you so much.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload