• ishaan99 (12/8/2008)


    Has anyone tried calling a stored procdure from a user defined function. I have a procedure as Proc_XXX with 7 parameters if i do exec Proc_XXX(null,null,null,null,null,'1/1/1998','1/1/2007') i am getting the result set. Is it possible to have the same results when calling thru a function .

    call Proc_XXX(null,null,null,null,null,'1/1/1998','1/1/2007')

    any help on this will be greatly appreciated. TIA

    Hi, you should use a stored procedure, becouse by design it is impossible modify the database context outside the function.

    Recently I found a workaround using external .NET function, I described well in my site.

    The post is in Italian, but you can find useful informations:

    http://www.maurodalfreddo.it/archives/97/eseguire-stored-procedures-in-una-funzione-udf-sql-server

    Mauro