troubleshooting Question

VB.Net SQL Query 2 Tables Different Databases

Avatar of Jimbo99999
Jimbo99999Flag for United States of America asked on
.NET ProgrammingDatabases
3 Comments3 Solutions379 ViewsLast Modified:
Good Day Experts!

I find myself in a bit of a jam here.  Long story short I need help with a query in which I need to join a table in a different database using data on the record from the first table.

Invoice --> 1234
Account --> ABC0101
Table --> Staging
DataBase --> A

Orders --> multiple records
Invoice --> 1234
Database --> ABC0101
Table --> Orders

I am having trouble figuring out how to use the Account data from Staging table as the Database for the second table so I can join on Invoice.

Is this possible? Databases are on the same server.

Éric Moreau
Senior .Net Consultant
Join our community to see this answer!
Unlock 3 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros