At 07:49 PM 2/12/2004, Jeff Varszegi wrote (in part) >I agree totally. And one completely-missed value of stored procedures is that they >provide a >layer of isolation from the raw database structure, allowing one to change the >structure without >breaking code. This applies to views, functions, etc. as well. [snip]
One technique I've used successfully, but have not seen discussed here, is that of having application code that generates the code for stored procedures, triggers, and views. Sometimes, that code will be "constant" -- but much of the time, it will vary based on column datatypes. If your application permits user-defined tables, user-added columns, or even user-specified column renaming, having the application able to provide updated stored procedure code that handles various schema changes is quite useful. If the application is to be installed for use by different entities (the ISV case), options that exist to make the app useful to different clients are best handled this way. I could give some real-world examples of where this has seemed to be the only reasonable solution, if anyone cares. It does threaten the job of any DBA who can't (or won't learn to) write application code, or can't get his head around the schema-definition mechanism the application uses to maintain the extra information needed by the code-generating code. J. Merrill / Analytical Software Corp =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
