• takilroy (7/17/2012)


    Unfortunately, I can't use look up tables because a default value for a parameter MUST be a constant, meaning either a literal value or a @@ constant. So, I'm really looking for a way to create a global variable that can be user/database defined? If anyone knows if this is possible, please let me know. Or if there is a way to really determine if a parameter is truly passed to a stored procedure--this seems like a flaw in SQL Server.

    Thanks so much,

    Teresa

    No, the lookup table is for what to compare the input paramater value to.

    Yes, the default value itself must indeed be a constant. So that part will have to change in every proc if you change the "magic" value.

    But by using the lookup table, you won't have to change any actual code in the proc.

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