home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2499
Discussions: 186,605, Posts: 2,227,029, Members: 230,239
Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
Old October 2nd, 2008, 12:05 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Oct 2008
Posts: 8
SQL concardination of two databases

How do I concardinate two databases i the same select statement -

I have a database containing all employees
and another one containing selected products

now i want to see all employees, and their choices, I have a key field in both, LoginID - buth physically its two bases - Ulrik


Last edited by Ulrik48 : October 2nd, 2008 at 12:29 PM.
Ulrik48 is offline   Reply With Quote
TechIMO.com Ads - Login or register for less ads.
How many errors does your computer have?

You no longer need to guess! This free stability scan and registry cleaner download will give you a complete diagnosis of your Windows registry, identifying errors and conflicts.

FREE instant scan


Guest, Register Free! to remove this ad and get your tech support questions answered in minutes!
Old October 2nd, 2008, 01:05 PM     #2 (permalink)
SoMuchAnime-SoLittleTime
 
EXreaction's Avatar
 
Join Date: Aug 2003
Location: Plymouth, WI
Posts: 13,697
Blog Entries: 1
Send a message via ICQ to EXreaction Send a message via AIM to EXreaction Send a message via MSN to EXreaction Send a message via Yahoo to EXreaction
Do you have two databases or just two database tables in the same database?

Between two tables is easy. I've never done a select between multiple databases, but I think I know of a way to do it as long as they are both on the same SQL server and are accessible by the same user account you've logged in with.
__________________
The mark of the immature man is that he wants to die nobly for a cause, while the mark of a mature man is that he wants to live humbly for one.

EXreaction is offline   Reply With Quote
Old October 2nd, 2008, 01:14 PM     #3 (permalink)
SoMuchAnime-SoLittleTime
 
EXreaction's Avatar
 
Join Date: Aug 2003
Location: Plymouth, WI
Posts: 13,697
Blog Entries: 1
Send a message via ICQ to EXreaction Send a message via AIM to EXreaction Send a message via MSN to EXreaction Send a message via Yahoo to EXreaction
Yep, I've tested it out and you can do a selection between multiple databases as long as it is on the same SQL server and the same user account has access to both.

You could do something like:
Code:
SELECT e.*, p.*
FROM employee_database_name.employee_table_name e, product_database_name.product_table_name p
WHERE e.LoginID = p.LoginID;

EXreaction is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading MySQL databases reiss Webmastering and Programming 2 June 1st, 2006 11:26 AM
XP SP2 and multiple SQL Server databases tiny-r Applications and Operating Systems 3 October 19th, 2004 05:49 PM
MySQL is busted, Need help backing up databases e980238 Webmastering and Programming 7 August 5th, 2002 10:05 AM
Databases without command line access? willy_ph Webmastering and Programming 2 April 14th, 2002 06:11 PM
How to properly move DHCP/WINS databases between Servers?? plucky duck Certification and Education 3 December 10th, 2001 02:59 PM

Most Active Discussions
Is It Just Me? (522)
Misery Loves Company... (1849)
Why Does the MOON Grow Bigger as It.. (16)
heatsink issue (10)
New Mobo (18)
SSD's, RAID, and External Backup (7)
1 internet. 1 house. 3 computer. ho.. (13)
Is This A Compatible Gaming PC? (18)
UPGRADING C/D DRIVE TO 250GB & .. (12)
Recent Discussions
PNY vs Gainward (3)
UPGRADING C/D DRIVE TO 250GB &a.. (12)
Linksys WRT54G (2)
Contest: Logo and Banner design.. (0)
Hotmail Q (2)
SSD's, RAID, and External Backu.. (7)
Laptop doesn't stay connected t.. (7)
Computer won't start (4)
Official World of Warcraft Thre.. (4528)
FS: Dell 6000 laptop, modded 36.. (2)
Apple iPod touch 16 GB $200 (4)
Six 28-Disc Cross Design Black .. (4)


All times are GMT -4. The time now is 11:01 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28