Can I create a view in my database server from another database server

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;
Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 后端存储 » Can I create a view in my database server from another database server

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录