Re: Newbie question: query over two data sources



This is a real "it depends" answer.

One option is to use linked servers and a single query on the server that
has the link to the other server. This works well if you have low latency
and this is not a critical part of your day to day operations.

Another option is to move both databases, via repliction generally, to
another server and use joins across databases. This is a better option if
the need for the joins is reporting, where you can churn for awhile. It
might also be wise to blend schemas on the replicated databases to create a
single database, but this is not always possible. In the same vein, you
might replicate just the tables in question to your main database, althoguh
this is not generally the best pattern.

If you are going to get hammered if you link and a third database is not an
option, you might be better to run separate queries and merge the data in
some form of data construct, like a DataSet. This can perform a bit better
if you have to update info in both databases, but you will have to write the
transactional bits yourself and watch both transactions for failure, so you
can fail the other transaction. If you do not, you will end up with the
databases out of sync. Hopefully, your updates are pretty much in sync.

Which of these should you choose? It really depends on the application and
what you are doing with the two databases.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"N Ramsay" <neil@xxxxxxxxxxx> wrote in message
news:228b2a10-b26a-4307-bd5f-81427d991ede@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I need to create some SQL queries that join over two data sources.

I can easily create connection strings to these data sources, but am
unclear how to create my SQL.

I'm a real noob to this, and up until now have been using the
drag&drop tools in Vis Web Dev Express.

If I look at the asp code for queries on a single db, I understand
exactly what's going on, but can't seem to work out how to using
mutiple data sources.

Many Thanks in advance.


.



Relevant Pages

  • Re: HELP!! My email server crashed!!
    ... As exchange processes transactions the ... change are not made directly inside the databases. ... first written to a transaction log file and then the transactions are played ... When a server is cleanly and gracefully shutdown ...
    (microsoft.public.exchange.admin)
  • Re: AS2005 ... what is wrong with it?
    ... What I have seen is that the dev server is *faster* than the prod server ... And does your dev server also have all 6 databases with all these roles? ... When I restore the "PROV" i got approx 20 sec. ... Starting from an empty data folder should show if this theory is true ...
    (microsoft.public.sqlserver.olap)
  • 2nd Post - Trouble Getting VS.Net 2003 WalkThrough working
    ... the server. ... MSDE either from the Setup or from the SQL2KDeskSP3 execute. ... it does look like some of the sample databases have been ... >> and they directed me to install MSDE and they attached a ConfigSamples ...
    (microsoft.public.sqlserver.msde)
  • RE: Server Explorer & Databases
    ... As for the visual studio's database server explorer, ... oracle, visual studio generally use the OLD DB provider which is for Oracle ... and support of most general funcctionalitis in latest version of Oracle. ... #Server Explorer for Oracle Databases ...
    (microsoft.public.vsnet.ide)
  • Re: 2nd Post - Trouble Getting VS.Net 2003 WalkThrough working
    ... The fact that the other databases exists phyiscally doesn´t mean that they ... can try to connect to SQL Server using OSL or a GUI. ... The Command OSQL ist for the commandline under DOS. ... > this MSDE either from the Setup or from the SQL2KDeskSP3 execute. ...
    (microsoft.public.sqlserver.msde)