mercredi 3 décembre 2014

How to know from where a UDF is being run


A funny situation for which I'd like some advice. We have a database that has been copied, including stored procedures but not user defined functions. When I run a stored procedure that calls a user defined function on the copied database it runs without apparent error and seems to call a superseded version of the user defined function. I'm deducing this from the results as the UDF is not shown to be in the database (no records: select name from sys.objects where type_desc like '%function%').


When I install the UDF and then run the SP I get the correct results. If I then delete the UDF I get an error message about the UDF not being found.


I'm guessing the UDF must have been run from cache initially, but I'm puzzled as to why it did not give an error message if it was not currently in the database.


What's a good way to see where the UDF is being run from?





Aucun commentaire:

Enregistrer un commentaire