• I really think you're going to drive people crazy trying to follow this because no one else does it.

    Almost universal is to use NULL to mean "no value was passed in for this parameter".

    If you actually need to be able to pass in an actual NULL, you will have to use a flag of some sort, as someone mentioned earlier.

    [Personally I think SQL should have a function that would "tell" me if a parameter was actually specified or not, so I could tell "missing NULL" from "provided NULL", but, AFAIK, it doesn't.]

    If you try to use the "magic" value approach, you will have to modify the procs every time, since the default value, as you noted, MUST be a CONSTANT.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.