A general question on what everyone's opinion is on storing SQL queries within a configuration file?
Is this just another bike shed?
Cheers, Ben
No. never. Seriously ;) Cleaning up that here at the moment.
Try looking at BLToolkit - stores them in attributes right on the abstract class they dynamically generate the whole accessing code under. Same like using it in the config file, but without writing or seeing the stupid DAL code.
Doesn't sound so bad to me, provided it meets the requirements.
Are you trying to allow the customer to see and edit the queries?
Are you trying to make it easier for development/testing?
I certainly prefer this to embedding the queries in code.
But there is a risk that this file will bloat with a myriad of slightly different queries (SORT ASCENDING, SORT DESCENDING, SUM(col1) + SUM(col2), SUM(col1) + SUM(col3), etc.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With