Error joining tables from separate db's using SqlCommand object
From: Elton Wang (anonymous_at_discussions.microsoft.com)
Date: 01/27/05
- Next message: nick_nw: "Please help! Setting SelectCommand.Transaction property blocks (locks thread)."
- Previous message: Ollie Riches: "Re: ARITHABORT...."
- In reply to: Corbin: "Error joining tables from separate db's using SqlCommand object"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 27 Jan 2005 05:41:30 -0800
BTW, is the owner of table Portal_Users dbo? If the owner
is not dbo, you have to name it
titlepost.OwnerName.Portal_Users. The
titlepost..Portal_Users means titlepost.dbo.Portal_Users.
Hope it helps,
Elton Wang
elton_wang@hotmail.com
>-----Original Message-----
>I'm trying to run a query that joins tables from 2
databases on the
>same server. The query is like this:
>
>SELECT TitleID, u.Name as Assignee
>FROM tblTitle t
>LEFT JOIN titlepost..Portal_Users u
>ON t.TitleProcessor = u.email
>
>When I put it in a stored procedure and execute the sp
using SqlCommand
>object, there are no problems. But I need to be able to
run this query
>using the CommandText property rather than by calling a
stored
>procedure. When I attempt this, I get "Invalid object
name
>'titlepost.dbo.PortalUsers'". My connection string is
>"server=10.10.10.10;Trusted_Connection=true;database=abstr
actors"
>Any suggestions are appreciated.
>
>Corbin
>
>.
>
- Next message: nick_nw: "Please help! Setting SelectCommand.Transaction property blocks (locks thread)."
- Previous message: Ollie Riches: "Re: ARITHABORT...."
- In reply to: Corbin: "Error joining tables from separate db's using SqlCommand object"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|