How to query data from one SQL DB from another SQL DB
I have a single SQL server with several databases on it. There are two databases I am actively using. There is a stored procedure I want to create that gathers certain data from one database and dumps into temporary tables into another. Or to better rephrase the question I want to be a be to run a query from one database that gathers data from another SQL database that is on the same server. How can I go about this? Some of the examples I found so far are not very clear.