Solved

how to create a view for a table which is exist in another database

Posted on 2016-09-29
2
26 Views
Last Modified: 2016-09-30
Hi Experts,

I have a two databases
Test1
Test2

Test1 database have table called items


I want this table data in Test2 database
I want to create a view for this table and i have to access the data via view in Test2 database;

Can some one suggest me how to do a view creation
how to get the data from Test1 database items table to Test2 database xxx view

please find the table data  in the attachment.
test.PNG
0
Comment
Question by:srikotesh
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 41822999
you can always do this:
select * from otherdatabase.tablename

Open in new window


and this can be done in a view also
use test1

create view test2_Items_view
as 
select * from test2.items

Open in new window

0
 
LVL 2

Author Comment

by:srikotesh
ID: 41824021
CREATE VIEW `D2`.`example` AS SELECT * FROM `D1`.`T1`;

http://stackoverflow.com/questions/10694601/creating-view-across-different-databases
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 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