• quote:


    Could you please give me some insight/examples of how to write a stored procedure that joins data from a table in one database with data in another database?


    Like Allen said, use the fully qualified name:

    
    
    SELECT
    d1.Field1 AS "Database 1 Field 1"
    , d2.Field3 AS "Database 2 Field 3"
    FROM MyDatabase1.dbo.MyTable d1
    INNER JOIN MyDatabase2.dbo.MyTable d2
    ON d1.PrimaryKeyField = d2.ForeignKeyField

    quote:


    Also, can you expand more on the "Controlling" application database?


    A "controlling" application is simply an application database that your team or your business thinks is the most central to the organization. The application database doesn't literally "control" anything, it simply is the only database that has tables which store central or common data to other application databases.

    --

    It must be noted that there are many different opinions on this subject and there really isn't one right answer. The correct answer for you will be one that feels right to you, one that you think will be easiest for you to administer and/or develop applications with, etc.

    --

    Here's a thread you might be interested in:

    http://qa.sqlservercentral.com/forum/topic.asp?TOPIC_ID=8029&FORUM_ID=49&CAT_ID=1&Topic_Title=One+or+More+than+One+Database%3F&Forum_Title=Strategies

    Edited by - jpipes on 08/20/2003 2:38:19 PM