Hi
I'm working on an ASP project where the clients want to be able to
effectively perform SELECT queries joining tables from two different
databases (located on the same SQL-Server).
Does this involve creating virtual tables that link to another database, or
am I completely on the wrong track?
Any hints as to where I might find more information (buzz-words, etc.) would
be most appreciated.
Thanks 10 25499
Try 'four part names' :).
server.database.owner.table
MC
"Captain Nemo" <ne**@nospam.com> wrote in message
news:6o****************@text.news.blueyonder.co.uk ... Hi
I'm working on an ASP project where the clients want to be able to effectively perform SELECT queries joining tables from two different databases (located on the same SQL-Server).
Does this involve creating virtual tables that link to another database, or am I completely on the wrong track?
Any hints as to where I might find more information (buzz-words, etc.) would be most appreciated.
Thanks
Use 3-part naming:
select
*
from
dbo.MyTable l
join
OtherDB.dbo.OtherTable o on o.PK = l.PK
--
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada www.pinpub.com
"Captain Nemo" <ne**@nospam.com> wrote in message
news:6o****************@text.news.blueyonder.co.uk ...
Hi
I'm working on an ASP project where the clients want to be able to
effectively perform SELECT queries joining tables from two different
databases (located on the same SQL-Server).
Does this involve creating virtual tables that link to another database, or
am I completely on the wrong track?
Any hints as to where I might find more information (buzz-words, etc.) would
be most appreciated.
Thanks
The OP said the two DB's were on the same server. Therefore, 3-part naming
is sufficient.
--
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada www.pinpub.com
"MC" <marko_culo#@#yahoo#.#com#> wrote in message
news:dr**********@magcargo.vodatel.hr...
Try 'four part names' :).
server.database.owner.table
MC
"Captain Nemo" <ne**@nospam.com> wrote in message
news:6o****************@text.news.blueyonder.co.uk ... Hi
I'm working on an ASP project where the clients want to be able to effectively perform SELECT queries joining tables from two different databases (located on the same SQL-Server).
Does this involve creating virtual tables that link to another database, or am I completely on the wrong track?
Any hints as to where I might find more information (buzz-words, etc.) would be most appreciated.
Thanks
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message
news:LB*******************@news20.bellglobal.com.. . The OP said the two DB's were on the same server. Therefore, 3-part
naming is sufficient.
-- Tom
It sure is! I've just tried it out. Where I went wrong was thinking that
2-part naming would do it (omitting the 'dbo').
Thanks, Tom
Agreed, but why not provide a more complete info since theres a little
difference? He may need to pull data from two servers tomorrow...
MC
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message
news:LB*******************@news20.bellglobal.com.. . The OP said the two DB's were on the same server. Therefore, 3-part naming is sufficient.
-- Tom
---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com
"MC" <marko_culo#@#yahoo#.#com#> wrote in message news:dr**********@magcargo.vodatel.hr... Try 'four part names' :). server.database.owner.table
MC
"Captain Nemo" <ne**@nospam.com> wrote in message news:6o****************@text.news.blueyonder.co.uk ... Hi
I'm working on an ASP project where the clients want to be able to effectively perform SELECT queries joining tables from two different databases (located on the same SQL-Server).
Does this involve creating virtual tables that link to another database, or am I completely on the wrong track?
Any hints as to where I might find more information (buzz-words, etc.) would be most appreciated.
Thanks
There's often a performance difference.
--
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada www.pinpub.com
"MC" <marko_culo#@#yahoo#.#com#> wrote in message
news:dr**********@magcargo.vodatel.hr...
Agreed, but why not provide a more complete info since theres a little
difference? He may need to pull data from two servers tomorrow...
MC
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message
news:LB*******************@news20.bellglobal.com.. . The OP said the two DB's were on the same server. Therefore, 3-part naming is sufficient.
-- Tom
---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com
"MC" <marko_culo#@#yahoo#.#com#> wrote in message news:dr**********@magcargo.vodatel.hr... Try 'four part names' :). server.database.owner.table
MC
"Captain Nemo" <ne**@nospam.com> wrote in message news:6o****************@text.news.blueyonder.co.uk ... Hi
I'm working on an ASP project where the clients want to be able to effectively perform SELECT queries joining tables from two different databases (located on the same SQL-Server).
Does this involve creating virtual tables that link to another database, or am I completely on the wrong track?
Any hints as to where I might find more information (buzz-words, etc.) would be most appreciated.
Thanks
Do you mean that actually specifing servername slows down the query? Could
you explain why?
MC
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message
news:dR*******************@news20.bellglobal.com.. . There's often a performance difference.
-- Tom
---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com
"MC" <marko_culo#@#yahoo#.#com#> wrote in message news:dr**********@magcargo.vodatel.hr... Agreed, but why not provide a more complete info since theres a little difference? He may need to pull data from two servers tomorrow...
MC
"Tom Moreau" <to*@dont.spam.me.cips.ca> wrote in message news:LB*******************@news20.bellglobal.com.. . The OP said the two DB's were on the same server. Therefore, 3-part naming is sufficient.
-- Tom
---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com
"MC" <marko_culo#@#yahoo#.#com#> wrote in message news:dr**********@magcargo.vodatel.hr... Try 'four part names' :). server.database.owner.table
MC
"Captain Nemo" <ne**@nospam.com> wrote in message news:6o****************@text.news.blueyonder.co.uk ... Hi
I'm working on an ASP project where the clients want to be able to effectively perform SELECT queries joining tables from two different databases (located on the same SQL-Server).
Does this involve creating virtual tables that link to another database, or am I completely on the wrong track?
Any hints as to where I might find more information (buzz-words, etc.) would be most appreciated.
Thanks
MC (marko_culo#@#yahoo#.#com#) writes: Do you mean that actually specifing servername slows down the query? Could you explain why?
If the server name use is @@servername, SQL Server will shortcut, and
there is no overhead.
But if the linked server is defined a true loopback, so that there is a
new connection made, there is obviously an overhead, as data is first
passed to SQL Server, to the OLE DB provider on one connection, and then
the OLE DB provider passes the data back to another connection.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx
Thank you for that, I assumed engine would 'optimize' that and never
checked. Just when I think I actually know something ;).....
MC
"Erland Sommarskog" <es****@sommarskog.se> wrote in message
news:Xn**********************@127.0.0.1... MC (marko_culo#@#yahoo#.#com#) writes: Do you mean that actually specifing servername slows down the query? Could you explain why?
If the server name use is @@servername, SQL Server will shortcut, and there is no overhead.
But if the linked server is defined a true loopback, so that there is a new connection made, there is obviously an overhead, as data is first passed to SQL Server, to the OLE DB provider on one connection, and then the OLE DB provider passes the data back to another connection.
-- Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Kenneth Fosse |
last post by:
Hi.
I'm currently working on a project which involves the creation of a
web page which reports selected data to customers from two back-end
systems. I use ASP script language on IIS, the server...
|
by: John Baker |
last post by:
Hi:
I just ran an Access application on someone elses system (With Access 2002). I made some
changes (on his system) and then copied the program (data and program are still on the
same file)...
|
by: Prakash RudraRaju |
last post by:
Hi,
I have recently migrated MSAccess Tables (nearly 120) to MySQL. To test
successful migration I want to compare all tables. I have linked MySQL
tables through ODBC connection.
I want to...
|
by: recumbent4sale |
last post by:
I work in a non-profit where people are quite computer illiterate and
have always created new files every year.
I know that making new tables/db's is usually a bad idea, particularly
for saving...
|
by: Coquette |
last post by:
Hi all. I'm new here. I wanted to ask your opinion about *joining two
tables* from *two different database* together. Is *that* possible? My
project requires me to join identical tables from...
|
by: Matt |
last post by:
Using ASP and Access is it possible for me to update recordsets in two
different tables from data collection in one page? Basically, I need
user input on 1 page that contains multiple form field...
|
by: nights |
last post by:
hi! i'm just a newbie with php and mysql... and i'm having problems joining tables from different databases...
can you please help me? here's my query:
SELECT database1.table1.field1,...
|
by: =?Utf-8?B?VGVycnk=?= |
last post by:
Is it possible to join tables from different databases? If so, what is the
format of the select statement? Both databases are on the same server.
TIA,
--
Terry
|
by: Supermansteel |
last post by:
I am joining these 2 tables together in Access 2003 and can't figure out the exact way of writing this script......Can anyone help?
I have the following SQL:
SELECT...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |