Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

Join tables from different databases?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry - 06 Jul 2007 02:26 GMT
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,
Signature

Terry

Cor Ligthert [MVP] - 06 Jul 2007 05:23 GMT
Terry,

A lot of answers on your question here,

http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/search?g
roup=microsoft.public.dotnet.framework.adonet&q=join+different+databases


Cor,

> 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,
Mark S. Milley, MCSD (BinarySwitch) - 06 Jul 2007 16:08 GMT
Hi Terry -

The format is this:

[databasename].[object owner name (usally dbo)].[tablename]

use database1
select * from database2.dbo.mytable

Two things to note:

Cross-database queries (especially if you're combining results or
doing cross-database joins) are S L O W, especially on tables with a
massive amount of data. You may want to revisit your approach.

Make sure that whatever user you're connecting to the database as has
access to both databases.

Happy Coding,

-Mark

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.