Is it possible to create view in my database server of another servers database table?
Let's say you have a database called Testing
on server1
and you have another database Testing2
on server2
. Is it possible to create view of Testing2
's table Table2
in server1
's database Testing
?
Also, I am using SQL Server 2008.
Please let me know if you have any questions.
Thanks,
Yes, you can. First, you need to link to the other server, using something like sp_addlinkedserver
.
Then you can access the data using 4-part naming. Here is an example:
create view v_server1_master_tables as
select *
from server1.master.information_schema.tables;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With