Oh I don't doubt that it works.... but the intent is to put the result into a variable.... which is why there is an output variable in the first place... why put it into the variable in the sproc, only to select it... And then you pass in a null for the parameter so once again, it's not in a variable where I could use it again. It may have worked... but it needs to work right.

My point being that the OP didn't put OUTPUT on the parameter when calling the sproc... ultimately that's all that was really missing from the original code... otherwise it was perfectly fine.

-tg