>>>Nope,
>>>and that is that makes me crazy.
>>>I'm now digging to understand WHY!
>>
>>Try to return the return code. I'm thinking (but I'm working on something else at the moment), perhaps it automatically switches to another database (master)?
>
>No, sp_executesql is executed in current datbase context If it changes the database you will have an error if you not fully qualify your table.
Ok, so what did you find?
If it's not broken, fix it until it is.
My Blog