Basically I want to use PRINT
statement inside a user defined function to aide my debugging.
However I'm getting the following error;
Invalid use of side-effecting or time-dependent operator in 'PRINT' within a function.
Can this not be done?
Anyway to aid my user defined function debugging?
You can't use a print inside a FUNCTION. Try using a SELECT instead. And of course, the SELECT would have to 'fit' with the FUNCTION return datatypes.
Tip: generate error.
declare @Day int, @Config_Node varchar(50) set @Config_Node = 'value to trace' set @Day = @Config_Node
You will get this message:
Conversion failed when converting the varchar value 'value to trace' to data type int.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With