Is there any way I can check for an error in a sub-query just like we check for Null using IsNull?
For example, I need something like:
Select IsError((Select A From ABC Whete X=123), 0) ColA, ColB From MyTable
As shown, there could be a syntax error in the sub-query, a conversion error at run-time or even a missing parameter. The sub-query is injected at run-time and it's not possible to determine validity beforehand.
If the sub-query fails for any reason, I should get 0 returned in ColA.
Yes, I know that's dangerous, injecting a subquery. The sub-query is expected be correct in 99.9% of the cases. But I want to catch any error if all it happens.