I agree with Allan. In this situation (if I understand it correctly), I would have two queries in the stored procedure and determine the one to run based the parameters supplied.
-Mike
>I haven't reached that point yet. Basically my problem is this. Most of the reports in question revolve around lists of members and products. In order to handle long lists efficiently I converted the list to xml and passed the lists to a sp where it returned a result. The problem arose when the user wanted to see members with zero sales. There were no records present in the sales table and I had used inner joins to retrieve all matching records. In order to achieve this I need to change the inner to a left outer join, but I don't want to make a new procedure to handle this. How have others been able to handle this type of situation? It seems to me that multiple procedures to handle this would be poor design and unnecessary. That being said, would placeing the executesql stored procedure in what I have created already be preferrable or am I going about this the wrong way?
>
>Thanks again
>Kelly