What permissions do I need if database a contains a stored procedure that inserts into a table in database b (same machine)? I have a stored procedure in database a that contains dynamic sql to perform an insert into a table in database b.  What permissions does the executing user need on database b?
if the procedure uses execute as owner then the owner of the proc needs rights to database b and the table in database b.
if the procedure does not use execute as owner then the calling user needs rights to database b and the table in database b.
if cross-database ownership is on, then "it depends"
here is a link that speaks to options there:
Cross-Database Ownership Chaining