• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

In query designer How do I add table from different database

I am creating new view in enterprise manager.
In query designer When I select add table ,It displays  all tables for the current database,
My question is How do I add table from different database same server.

Is it not possible in query designer ?


  • 2
3 Solutions
It's not possible to display them in the tables list, but you can type in the full name of the table in the SQL window (database.owner.object) and so include it in your query. However, since there is no referential integrity checks across databases it will not automatically create the join between it and any of your other tables, you will need to manually specify the join.
SELECT * INTO targetDatabase.dbo.NewTableName
  FROM sourceDatabase.dbo.SourceData

You can also try creating a view in your current database that points to this table on the other database.  That way you can do a select on your view and will not have to create any reference to another database.

Hope this helps
point split if fine with me..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now