Cory, as far as I know, you won't have access to the @@procid database id. Much the same "problem" as the whole "sp_depends" cross-database hole. Without additional programming (such as setting/getting app_context, for example, or mda, or temp tables, etc), you can't determine this from a global variable, SYS_SESSION context, or builtin call.
↧