Board index » delphi » one query on two databases

one query on two databases

I have to run this query, but I have problems because cdr (D) is in another
database (on the same server) how can I make it run?

thank you

SELECT
D.*, C.tariffcode
FROM
cdr D, billing_user B, company C
WHERE (D.clientbill ='0')
AND (B.user_id=D.id)
AND (C.company=B.company)

 

Re:one query on two databases


Which database are you using? Sintax vary from one to another

--
Ing. Eduardo Martinez Ocampo
Chief of Information Systems
Industria Envasadora de Queretaro, S.A, de C.V.
"The Coca-Cola Canning Plant"
Queretaro, Qro Mexico

Re:one query on two databases


MS SQL v6.5
"Eduardo Martinez Ocampo" <eduar...@nospam.ieqsa.com.mx> wrote in message
news:3a8adb44_1@dnews...
Quote
> Which database are you using? Sintax vary from one to another

> --
> Ing. Eduardo Martinez Ocampo
> Chief of Information Systems
> Industria Envasadora de Queretaro, S.A, de C.V.
> "The Coca-Cola Canning Plant"
> Queretaro, Qro Mexico

Re:one query on two databases


i think

SELECT
D.*, C.tariffcode
FROM
":anotherdatabase:cdr" D, billing_user B, company C
WHERE (D.clientbill ='0')
AND (B.user_id=D.id)
AND (C.company=B.company)

Quote
Ioan Ghip wrote:
> I have to run this query, but I have problems because cdr (D) is in another
> database (on the same server) how can I make it run?

> thank you

> SELECT
> D.*, C.tariffcode
> FROM
> cdr D, billing_user B, company C
> WHERE (D.clientbill ='0')
> AND (B.user_id=D.id)
> AND (C.company=B.company)

Re:one query on two databases


thank you
Quote
> i think

> SELECT
> D.*, C.tariffcode
> FROM
> ":anotherdatabase:cdr" D, billing_user B, company C
> WHERE (D.clientbill ='0')
> AND (B.user_id=D.id)
> AND (C.company=B.company)

Re:one query on two databases


In SQL Server 7

 SELECT
 D.*, C.tariffcode
 FROM
 databasename..cdr D, billing_user B, company C
 WHERE (D.clientbill ='0')
 AND (B.user_id=D.id)
 AND (C.company=B.company)

--
Sunil Furtado
New Mangalore Port Trust

Quote
Ioan Ghip <delphi12...@hotmail.com> wrote in message

news:3a8ad4be$1_2@dnews...

Re:one query on two databases


I don't use SQL Server but as you see you got some responses regarding your
database

--
Ing. Eduardo Martinez Ocampo
Chief of Information Systems
Industria Envasadora de Queretaro, S.A, de C.V.
"The Coca-Cola Canning Plant"
Queretaro, Qro Mexico

Other Threads