Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2004
    Posts
    28

    Unanswered: Need Advice/Help on querying a different db

    I have 2 different database's on the same server. I'm trying to create a stored proc that resides in Reporting database but queries against the Call database. 4 part naming convention gives me an error of 'invalid object name' What am I forgetting here?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    My first guess would be that you forgot how to spell the object name. The next guess would be that you are doing something that doesn't make sense, like SELECT * FROM myStoredProcedure or the equivalent.

    -PatP

  3. #3
    Join Date
    Oct 2004
    Posts
    28
    stored procedure lies in ABC4_Dev1_Reporting
    Data resides in ABC_Dev1_Call1

    From Reporting db in query analyzer I cannot get the following query to run

    select * from dbo.ABC_Dev1_Call1.Call (Call is the table)

    What am I missing?
    Thanks in advance!

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Ah, a snippet of code is worth a thousand words of description! I'd use:
    Code:
    SELECT *
       FROM ABC_Dev1_Call1.dbo.Call
    -PatP

  5. #5
    Join Date
    Oct 2004
    Posts
    28
    Ah... very interesting.... I'm claiming a bad case of the friday's on that one. I owe you one. Thanks a million. Have a good weekend.

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Listen...if Pat collected them all...he'd be hammered all year....

    You threw me with the 4 part naming convention.....

    See what happens when I take a break and get a sandwich...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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