MSSQL Union on two databases problem

Forum related to MS SQL Server

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
pipo75
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 26.01.2010, 13:48

MSSQL Union on two databases problem

Post by pipo75 »

Hi!

I try to make an uninion on two databases but i recieve error from server:
"The database name component of the object qualifier must be the name of the current database"

I use Delphi 7, MSSQL 2005, Zeos 6.6.4

SQL query:
SELECT * FROM
DB1.dbo.V1EVID_PREGL JOIN
DB2.dbo.Poslovni_Partnerji ON
DB1.dbo.V1EVID_PREGL.ID_PART=DB2.dbo.Poslovni_Partnerji.Stev_Partnerja_ID

What's wrong?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

I'm afraid you'll have to check that in MSSQL documentation...

Mark
Image
pipo75
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 26.01.2010, 13:48

Post by pipo75 »

The problem is that query works with "MS SQL Server Management Studio Express" but not with Delphi and Zeos components.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,

I did some google work. Seems like this error may be a driver bug.
Look at this post : http://connect.microsoft.com/SQLServer/ ... -not-match

If that's not really related there was also a post that seemed there might be a Upper/Lower case issue, as if Zeoslib may convert some parts of the query to a wrong case.
Maybe you could set a TZSQLMonitor to check if the queries sent have case changes. (Or an internal zeoslib metadata query fails)

Mark
Image
Post Reply