Re: How do I read records from databases in two different connections ?
From: Aaron Bertrand [MVP] (aaron_at_TRASHaspfaq.com)
Date: 04/02/04
- Next message: Meiko: "select where value in list"
- Previous message: Aaron Bertrand [MVP]: "Re: Date format"
- In reply to: CobraStrikes_at_al.com: "How do I read records from databases in two different connections ?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 2 Apr 2004 18:38:35 -0500
If the two databases are on the same server, use one connection. e.g. if
you use cn1, then
sql = "SELECT column1, column2 FROM tablename t1 RIGHT JOIN
db2.dbo.tablename t2 ON t1.column1 = t2.column1"
(Note you will want to check your syntax, I spot at least a few errors
there.)
-- Aaron Bertrand SQL Server MVP http://www.aspfaq.com/ <CobraStrikes@al.com> wrote in message news:c4kqtf$rcf$1@news8.svr.pol.co.uk... > Hi I will be most grateful if any one can help me. > I have 2 connections to two different databases. > cn1 has database db1 > cn2 has database db2 > > SQL = "SELECT field1,field2 FROM (db1 right join db2 on > db1.field1=db2.field1)" > > I get an exception error, I think it is because I am using two > connections. > Can anyone tell me how to build the string ??? > hope I explained well enough ????? > TIA > > >
- Next message: Meiko: "select where value in list"
- Previous message: Aaron Bertrand [MVP]: "Re: Date format"
- In reply to: CobraStrikes_at_al.com: "How do I read records from databases in two different connections ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|