Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7671587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:05:38+00:00 2026-05-31T16:05:38+00:00

I have to join queries from multiple databases, something like: SELECT T1.*, T2.* FROM

  • 0

I have to join queries from multiple databases, something like:

SELECT T1.*, T2.* FROM DatabaseA.dbo.Table1 AS T1
INNER JOIN DatabaseB.dbo.Table2 AS T2 ON T1.ID = T2.ID

My questions:

  • How should I setup the connection string of System.Data.SqlClient.SqlConnection? Should I omit or leave empty the Initial Catalog? Should I set it to DatabaseA?
  • Is this a good way to perform this task? I’m thinking to prepare a third DB without tables but with a view with that SELECT (I can’t put a view in the existing databases). Query usually is executed in 10/15 seconds but user has to wait so even few seconds less will be appreciated.

All DBs share the same login credentials.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:05:39+00:00Added an answer on May 31, 2026 at 4:05 pm

    This depends on the login within your connection string more than the Initial Catalog.

    You can specify either database in your connection string, as long as the login that you’re using has the permission required to query from both tables in both databases.

    There’s nothing inherently wrong with a query that spans multiple databases, so your proposed solution looks good to me.

    Just be aware that if you’re the one designing these databases, and determining which tables should live in which databases, that there is no referential integrity across databases, so ideally any tables that relate to each other should live in a single database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a join in a oracle query which looks like: FROM eiv.table1 eiv.table2
Basically I have a mysql query something like the following: mysql_query(SELECT n.title, v.value FROM
If I have queries on multiple tables like: d = Relations.objects.filter(follow = request.user).filter(date_follow__lt =
I have multiple select statements from different tables on the same database. I was
I have multiple queries (from different section of my site) i am executing Some
I have used a join query for retrieving value from two tables one is
I have a right outer join, that almost does what I want... SELECT users_usr.firstname_usr,
I have the following query: UPDATE lessonstatus INNER JOIN user ON lessonstatus.user_id = user.user_id
I have a query containing three inner join statements in the Where clause. The
I have a materialized view of a complex join, which I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.