Results 1 to 6 of 6

Thread: lookup

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: lookup

    I want to lookup values from a database into another database both of which are in the same sql server 2000. One databases is called GamingCommissiondb the other is called LicensingActions I need some of the tables to communicate with each other, to look values from one another. Example I need the Termination table to look up values from the Revocations table. Would using LinkedServers suffice??

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Liked Server option would be a little tricky because it's the same server. Specifying the NETBIOS server name will give you an error if it's a default instance or the only named instance. You will need to specify "(local)" without quotes and reference it like this: [(local)]. But you really don't need a linked server, you can perform cross-database queries using 3-part naming, like PUBS.DBO.AUTHORS, your_database.schema_owner.object_name
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    trying to understand

    thank you for responding so what you are saying is that i can use a select statement. Can I make that into a VIEW. I need to create a command button that will lead to a table on another database. See everytime a person is rehired the users need to see the applicants past history. Thats why I thinking Either Linked Servers Or Linked Tables

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Yup, a view would do it. Both databases have to have users that intend to use this view.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    SQL Server uses databases pretty much as simple containers, they aren't nearly as isolated from each other as they are on other database engines. As long as your code provides the DATABASE_NAME.OWNER_NAME.OBJECT_NAME syntax, SQL Server doesn't really care what database you are using for most purposes.

    -PatP

  6. #6
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Talking Yes

    ALLLRIGHTY THEN ....Ok success a view does the Trick a view OMG the more I work In SQL the More I understand it. I really need to get more comfortable with the Query Analyzer.

    Thank you so much guys I sure do appreciate it

    HAPPY DANCE!!!!!!!!!!!!!!!!!!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •