>>>Frank,
>>>
>>>One thing you could do is just add a default value in your stored procedure that will be used in the occurence of no value being passed to the stored procedure. Then the stored procedure will still run even if you do not pass a paramter value for one that has a default
>>>
>>>Here is an example:
>>>
>>>
>>>CREATE PROCEDURE [dbo].[ClientSelectByDynamic]
>>> @ClientNumber int = 0, @ClientName char(20) = ' ', @PolicyNumber char(20) = ' '
>>>
>>>AS ...
>>>
>>>
>>>I have never passed null as a parameter, but you could very easily pass something else (like a blank) and do what you want based on this input.
>>>
>>Thanks Bob,
>>
>>in the meantime I had changed the stored procedure to test for blanks instead of nulls and that works, but I feel nulls make a bit more sense. I'll see if the default values will help.
>>
>>FWIW this is the article that I am trying to understand and implement the technique from:
>>
>>
http://www.sqlservercentral.com/articles/Dynamic+SQL/70109/>
>Yes, it's a good article. Take also a look at this blog on this exact topic - may be even easier to understand
>
http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/do-you-use-column-param-or-param-is-nullThanks