Solved

In query designer How do I add table from different database

Posted on 2004-09-24
7
283 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
  • 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

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

828 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