• TheSQLGuru (10/26/2012)


    sys.dm_exec_query_plan ( plan_handle ) has a dbid field.

    That column shows null for adhoc and prepared statements

    Guess I'll have to do some serious digging..

    Thanks