Posted by Simon Hayes on 09/29/05 10:47
If you don't want to write three separate queries, then you'll probably
have to use dynamic SQL and build up the query string dynamically:
http://www.sommarskog.se/dyn-search.html
http://www.sommarskog.se/dynamic_sql.html
Alternatively, you could simply return all the columns all the time
(perhaps using CASE to return empty values for the unwanted columns so
as to minimize the data volume) and let the client decide which ones to
present/process, but in a more complex case it might not be workable.
Simon
Navigation:
[Reply to this message]
|