Need a "stored something" that supports TRY/CATCH and being called from a SP like UDF
I have been banging into limitations of what SQL Server 2008 R2 will not support.
I coded up a slick little UDF, debugged it in SSMS interactively, then tried installing the UDF only to find that TRY/CATCH blocks are not supported in UDF's.
I recoded in Stored Procedure (SP) style, only to receive a gripe trying to call that SP as if it were a UDF within the SELECT of another SP.
The reason I need to use TRY/CATCH is for these conversion UDF's, I was going to utilize the same sort of error checking as I did for these VBA validator functions:
Request for critique of my IsInt function - Generic Data Type Validation
http://www.access-programmers.co.uk/forums/showthread.php?t=241516&page=2#post1231644
That if the conversion fails for some reason, then the CATCH would supply a default/error return code, which would be the value the SELECT in the SP will return.
Suggestions of a way forward? My creativity is tired of being told a three letter answer... "NO!" :banghead:
I have been banging into limitations of what SQL Server 2008 R2 will not support.
I coded up a slick little UDF, debugged it in SSMS interactively, then tried installing the UDF only to find that TRY/CATCH blocks are not supported in UDF's.
I recoded in Stored Procedure (SP) style, only to receive a gripe trying to call that SP as if it were a UDF within the SELECT of another SP.
The reason I need to use TRY/CATCH is for these conversion UDF's, I was going to utilize the same sort of error checking as I did for these VBA validator functions:
Request for critique of my IsInt function - Generic Data Type Validation
http://www.access-programmers.co.uk/forums/showthread.php?t=241516&page=2#post1231644
That if the conversion fails for some reason, then the CATCH would supply a default/error return code, which would be the value the SELECT in the SP will return.
Suggestions of a way forward? My creativity is tired of being told a three letter answer... "NO!" :banghead: