Hi guys,
I have stored proc in pseudo code as below:
There is an issue in query_2 due to data conversion but the stored proc continues until the end and the last query (query_3) was running fine hence the return code is 0 and we have seen it from query window
Then we are trying to run this stored proc via SQL Agent job and it bombs out when it runs the query_2.
Do you guys have any idea why they behave different way while execute the same stored proc? it gives us inconsistent result and we never knew query_2 had an issue.
And how to force to finish the whole stored proc as run in query window in SQL Agent job.
Stored proc compiled with no errors.
Thanks in advance guys,
I have stored proc in pseudo code as below:
Code:
query_1
query_2
query_3
There is an issue in query_2 due to data conversion but the stored proc continues until the end and the last query (query_3) was running fine hence the return code is 0 and we have seen it from query window
Then we are trying to run this stored proc via SQL Agent job and it bombs out when it runs the query_2.
Do you guys have any idea why they behave different way while execute the same stored proc? it gives us inconsistent result and we never knew query_2 had an issue.
And how to force to finish the whole stored proc as run in query window in SQL Agent job.
Stored proc compiled with no errors.
Thanks in advance guys,