Ways to access tables from different databases across multiple servers

Source: Internet
Author: User

/*methods of accessing different tables across multiple servers first create a linked server testt,* the RPC configuration of the linked server ' TESTT ' cannot be directly modified under MSSQL2008 to Ture, which can be modified by the following statements:*/ Use [Master]GOEXECMaster.dbo.sp_serveroption@server=N'Testt',@optname=N'RPC',@optvalue=N'true'GOEXECMaster.dbo.sp_serveroption@server=N'Testt',@optname=N'RPC out',@optvalue=N'true'GO--and then access it through the SQL statementSelect *  from [Testt].[online_payment].[dbo].[Tb_user]/*ways to access different tables across multiple servers two*/--Enable ad Hoc distributed Queries:execsp_configure'Show advanced Options',1 Reconfigure execsp_configure'Ad Hoc Distributed Queries',1 Reconfigure --The Access statement writes like thisSelect *  from OpenRowset('SQLOLEDB','10.176.24.111';'SA';'123', ONLINE_PAYMENT.dbo.TB_USER) a--Close ad Hoc distributed Queries:execsp_configure'Ad Hoc Distributed Queries',0 Reconfigure execsp_configure'Show advanced Options',0 Reconfigure

Ways to access tables from different databases across multiple servers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.