Using two databases

Abstract: Using two databases

    Question

How can I create stored procedures, triggers, queries, user defined functions, or foreign keys that access data in two different databases?

    Answer

You cannot. If you need to use information from two databases in a single query, trigger, stored procedure, or user defined function, then the data is probably related such that it should be contained in two tables in a single database instead of in two separate databases.