• Very much appreciated. I've not yet done a lot of testing or looked at the logic in detail, however, I did notice something peculiar. If the input parameter is varchar(500), how can the output parameter also be varchar(500)? If I indeed send all 500 characters in, it seems the result coming back would be truncated.

    This is just a minor detail, but it could create problem that could be hard to diagnose.