btw - I am assuming it's complaining about the "must declarescalar var..." - because of SCOPE...
And that is my question... it obviously parses the param string well enough to identify the parameter..
however, my var is declared BEFORE the @sql string is generated - so i can't figure out how to put it all together....