Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Multi Database View

Options
  • 05-05-2005 2:54pm
    #1
    Registered Users Posts: 604 ✭✭✭


    Hi,

    I dont know if this is possible, I have a database which contains a table of users that i have updated daily using a DTS job. I want to create views that use this Table rather than creating more than one instance of this table.

    So can i somehow query this table from a different database ? or is that just not possible.


Comments

  • Registered Users Posts: 2,781 ✭✭✭amen


    yes if you are using MS SQL Server
    If the database in running in the same instance of SQL Server
    then its just
    SELECT * From MyOtherDatabase.DBO.MyView

    presuming DBO owns MyView otherwise replace it with the user who owns MyView(although I can never really think of a good reason for having non dbo owners)

    if its running on a different sql server instance you should look at linked servers on SQL Books online


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    Like Amen said....

    ...as an additional note, though, you'll want to read up on intra-database security in MSSQL, which is different from version to version. If memory serves, its also changed from service-pack to service-pack as well at time.

    Check the "books online" for Ownership Chaining.

    Course...if you're not implementing security in your databases in the first place (I only say this because I'm constantly staggered at the number of ppl who do stuff like hard-code logins with the 'sa' user into apps)...then this probably won't be an issue :)

    jc


Advertisement