如何在SQL Server Management Studio中创建和配置链接服务器

本文详细介绍了如何在SQL Server Management Studio(SSMS)中创建和配置链接服务器,包括使用SQL Server数据源,设置本地登录、远程用户、连接超时等参数。链接服务器允许在单个T-SQL语句中跨多个SQL Server实例联接数据,简化了数据操作。文章通过步骤演示了使用SSMS GUI界面和存储过程`sp_addlinkedserver`两种配置方法。
摘要由CSDN通过智能技术生成

Linked servers allow submitting a T-SQL statement on a SQL Server instance, which returns data from other SQL Server instances. A linked server allows joining data from several SQL Server instances using a single T-SQL statement when data exists on multiple databases on different SQL instances. By using a linked server to retrieve data from several SQL instances, the only thing that should be done is to connect to one SQL instance.

链接服务器允许在SQL Server实例上提交T-SQL语句 ,该语句从其他SQL Server实例返回数据。 当数据存在于不同SQL实例上的多个数据库上时,链接服务器允许使用单个T-SQL语句从多个SQL Server实例联接数据。 通过使用链接服务器从多个SQL实例检索数据,唯一要做的就是连接到一个SQL实例。

There are two ways of configuring linked server in SSMS. One way is by using sp_addlinkedserver system stored procedure and another is by using SQL Server Management Studio (SSMS) GUI interface.

在SSMS中有两种配置链接服务器的方法。 一种方法是使用sp_addlinkedserver系统存储过程,另一种方法是使用SQL Server Management Studio (SSMS)GUI界面。

In this article will be explained how to configure a linked server using a SQL Server data source. More information about other data sources can be found on this link.

在本文中,将说明如何使用SQL Server数据源配置链接服务器。 可以在此链接上找到有关其他数据源的更多信息。

To see all created linked servers in SSMS, under Object Explorer, chose the Server Objects folder and expand the Linked Servers folder:

要在SSMS中查看所有已创建的链接服务器,请在“ 对象资源管理器”下 ,选择“ 服务器对象”文件夹并展开“ 链接服务器”文件夹:

To create a linked server in SSMS, right click on the Linked Servers folder and from the context menu select the New Linked Server option:

要在SSMS中创建链接服务器,请右键单击“ 链接服务器”文件夹,然后从上下文菜单中选择“ 新建链接服务器”选项:

The New Linked Server dialog appears:

出现“ 新建链接服务器”对话框:

In this dialog, the name of a linked server and server type must be identified. The linked servers can be defined for different kind of data source if the Other data source radio button is chosen. For the purpose of this article, the SQL Server radio button under the Server type section will be chosen and in the Linked server text box, a name of the server will be entered:

在此对话框中,必须标识链接服务器的名称和服务器类型。 如果选择其他数据源单选按钮,则可以为不同类型的数据源定义链接的服务器。 出于本文的目的,将选择“ 服务器类型”部分下的“ SQL Server”单选按钮,并在“ 链接的服务器”文本框中,输入服务器的名称:

If the SQL Server type is chosen to configure a SQL Server linked server, the name specified in the Linked server text box must be the name of the remote SQL Server.

如果选择了SQL Server类型来配置SQL Server链接服务器,则在“ 链接服务器”文本框中指定的名称必须是远程SQL Server的名称。

If a SQL Server instance is default instance, type the name of the computer that hosts the instance of SQL Server (e.g. WSERVER2012). If the SQL Server is a named instance, type the name of the computer and the name of the instance separated by slash (e.g. WSERVER2012\SQLEXPRESS).

如果SQL Server实例是默认实例,请键入承载SQL Server实例的计算机的名称(例如WSERVER2012) 。 如果SQL Server是命名实例,请键入计算机的名称和以斜杠分隔的实例的名称( 例如WSERVER2012 \ SQLEXPRESS )。

Otherwise the following error may occur when the OK button is pressed:

否则,当按下“ 确定”按钮时,可能会发生以下错误:

To set how a user would authenticate to the WSERVER2012\SQLEXPRESS instance, under the Select a page section on upper left corner of the New Linked Server dialog, select the Security item:

若要设置用户对WSERVER2012 \ SQLEXPRESS实例进行身份验证的方式 ,请在“ 新建链接服务器”对话框左上角的“ 选择页面”部分下,选择“ 安全性”项:

Here, different ways to authenticate the linked server can be set.

在这里,可以设置认证链接服务器的不同方法。

Under the Local server login to remote server login mappings, two ways of local logging to a remote login can be set. One way is to associate a local login with a remote login and other way is to impersonate.

本地服务器登录到远程服务器登录的映射下,可以设置本地登录到远程登录的两种方式。 一种方法是将本地登录名与远程登录名相关联,另一种方法是模拟。

本地登录 (Local Login)

In the Local Login field, will be listed all the local logins. The local login can be an SQL Server Authentication local login:

本地登录字段中,将列出所有本地登录。 本地登录名可以是SQL Server身份验证本地登录名:

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值