Posted by --CELKO-- on 11/24/06 15:04
None of these were good suggestions.
>> .. you can use a table where you actually store the sql with different sets. For example insert table values (3, 'select extended set from sometable') <<
SQL is not meant to be used this way -- it stores data and not code.
Why not use a procedure instead?
>> .. you can pass the actual column names to the procedure and select only those columns etc. or pass a number and parse it to column names etc. <<
You cannot pass column names in T-SQL amd most programming languages.
And you should not do this anyway. You want strong cohesion in a
module (basic Software Engineering, duh!) which means you have a spec
that tells you exactly what the output will be. This "I don't know
what is happening until some random user decides at run time" or
"Briteny Spears, Squid or Automobiles" approach is just plain wrong.
Navigation:
[Reply to this message]
|