I have a 3rd party system that uses sp_executesql under the covers (figured that out with profiler). I have a procedure that works fine when calling it directly in SSMS, but when I call it via the same statement that this 3rd party system issuing, I get an error.
The procedure is using TRY/CATCH, so I can see the error message its returning, but why?
In both cases, I am executing both statements in SSMS, the one using execute works fine, but calling sp_executesql fails. The error message indicates its trying to insert a null value into a table, for which it should have already had, or least that's the case with calling the procedure directly (execute procedure_name...)