Procedures that invoke a nested procedure in another database with a fully qualified name

In the following example, Jane creates a procedure that invokes a nested procedure in another database with a fully qualified name. The login associated with Jane resolves to user Jane in otherdb. This example uses execute as owner:

create procedure p master  
    with execute as owner
    as exec otherdb.jim.p_child
grant execute on p master to bill

Bill executes the procedure:

In the following example, Jane creates the same procedure as above using execute as caller. The login associated with user Bill in the current database resolves to user Bill in otherdb:

create procedure p master  
    with execute as caller 
    as exec otherdb.jim.p_child
grant execute p master to bill

Bill executes the procedure:

exec jane.p_master