views:

49

answers:

2

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

+2  A: 

Did you try: SELECT db_name() ?

javamonkey79
A: 

You'd run a trace in SQL Profiler, but that might not give you complete list. So, you also should query the information_schema.routines & information_schema.tables views in each database to see which tables and view use that function and could call it and compare the list to the trace.

Booji Boy