Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-05-02 : 07:30:01
|
| Sam writes "Hi there,I'm trying to set up a dynamic user defined function, and so far I think I can only do it via a case statementmyFunction(@FUNCTION_NAME)BEGINCASE @FUNCTION_NAME WHEN 'function1' THEN EXEC function1 WHEN 'function2' THEN EXEC function2 WHEN 'function3' THEN EXEC function3 ELSE EXEC function4 ENDENDActually I'm not even sure that will work, but I know I can't do it as followsmyFunction(@FUNCTION_NAME)BEGINEXEC @FUNCTION_NAMEENDbecause I can only execute deterministic functions and extended functions from with a UDF.The functions I want to execute are deterministic, I would just like to be able to avoid a huge CASE statement to switch on their name.Any ideas? CHEERS> SAMp.s. I did search your FAQ and forums, and I couldn't find anything that directly addressed this issue." |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-05-02 : 09:45:31
|
| Well...first off...you don't EXEC udf's.Second, if you have to pass in the value, why not just call it?Are these stored procedure ofr udf's we're talking about?I'm so confused.Brett8-) |
 |
|
|
|
|
|