Defining the database from which the function is called in a separate utility database

I have several databases, one of which contains utility functions that are called from other databases. Is there a way in the utility functions to determine from which database the function is called?

0


source to share


2 answers


Have you tried: SELECT db_name ()?



+2


source


You are running a trace in SQL Profiler, but that may not give you a complete list. So you should also query the information_schema.routines and information_schema.tables views in each database to see which tables and views use this function, and you could call it and compare the list with the trace.



0


source







All Articles