Re: Newbie question: query over two data sources
- From: "Cowboy \(Gregory A. Beamer\)" <NoSpamMgbworld@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Feb 2008 09:31:42 -0600
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.
.
- Follow-Ups:
- Re: Newbie question: query over two data sources
- From: N Ramsay
- Re: Newbie question: query over two data sources
- References:
- Newbie question: query over two data sources
- From: N Ramsay
- Newbie question: query over two data sources
- Prev by Date: Re: VS mangles HTML
- Next by Date: Re: Reference To Instantiating Object
- Previous by thread: Newbie question: query over two data sources
- Next by thread: Re: Newbie question: query over two data sources
- Index(es):
Relevant Pages
|