Anyone have a work around for using sp_executesql like in the situation below within a user defined function.
EXEC sp_executesql @rule,N'@check_rule bit OUTPUT',@check_rule OUTPUT
I have tested the function parts in query analyzer the results are what I want but when I create the function I get the following error.
Server: Msg 557, Level 16, State 2, Procedure udf_airline_rules2, Line 27
Only functions and extended stored procedures can be executed from within a function.
When I remove the EXEC sp_executesql the function is fine, but I need to dynamically execute and return a value.
Thanks in advance,
bygs
EXEC sp_executesql @rule,N'@check_rule bit OUTPUT',@check_rule OUTPUT
I have tested the function parts in query analyzer the results are what I want but when I create the function I get the following error.
Server: Msg 557, Level 16, State 2, Procedure udf_airline_rules2, Line 27
Only functions and extended stored procedures can be executed from within a function.
When I remove the EXEC sp_executesql the function is fine, but I need to dynamically execute and return a value.
Thanks in advance,
bygs