?
Solved

SQL View

Posted on 2011-04-27
4
Medium Priority
?
219 Views
Last Modified: 2012-05-11
Can I create a view in one database over tables in another database? If so, how?
0
Comment
Question by:qbjgqbjg
4 Comments
 
LVL 6

Accepted Solution

by:
cfEngineers earned 1000 total points
ID: 35477619
You can pull information from other DB's on the same server by doing something like this.
select * from [mydb].dbo.mytable
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35477652
yes, that is perfectly possible.
0
 
LVL 41

Assisted Solution

by:Sharath
Sharath earned 1000 total points
ID: 35478091
>> Can I create a view in one database over tables in another database? If so, how?
like this.
use Database1
go
create view dbo.myView as 
select * from Database2.dbo.Table1
go

Open in new window

0
 

Author Closing Comment

by:qbjgqbjg
ID: 35479325
Thanks very much.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

850 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