Solved

In query designer How do I add table from different database

Posted on 2004-09-24
7
285 Views
Last Modified: 2008-07-03
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 ?

Thanks
Narendra

0
Comment
Question by:NarendraNisha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 17

Accepted Solution

by:
BillAn1 earned 43 total points
ID: 12143845
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.
0
 
LVL 19

Assisted Solution

by:peh803
peh803 earned 41 total points
ID: 12143848
SELECT * INTO targetDatabase.dbo.NewTableName
  FROM sourceDatabase.dbo.SourceData

peh803
0
 

Assisted Solution

by:EliasSportsBureau
EliasSportsBureau earned 41 total points
ID: 12147973
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
0
 
LVL 19

Expert Comment

by:peh803
ID: 12400520
point split if fine with me..
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question