Skip to content

Microsoft SQL 凭据#

¥Microsoft SQL credentials

你可以使用以下凭据验证以下节点:

¥You can use these credentials to authenticate the following nodes:

先决条件#

¥Prerequisites

Microsoft SQL Server 数据库上创建用户账户。

¥Create a user account on a Microsoft SQL server database.

支持的身份验证方法#

¥Supported authentication methods

  • SQL 数据库连接

¥SQL database connection

相关资源#

¥Related resources

有关连接到服务的更多信息,请参阅 Microsoft 连接到 SQL Server 文档

¥Refer to Microsoft's Connect to SQL Server documentation for more information about connecting to the service.

使用 SQL 数据库连接方式#

¥Using SQL database connection

要配置此凭据,你需要:

¥To configure this credential, you'll need:

  • 服务器名称

¥The Server name

  • 数据库名称

¥The Database name

  • 你的用户账户/ID

¥Your User account/ID

  • 你的密码

¥Your Password

  • 用于连接的端口。

¥The Port to use for the connection

  • 域名

¥The Domain name

  • 是否使用 TLS。

¥Whether to use TLS

  • 是否忽略 SSL 问题。

¥Whether to Ignore SSL Issues

  • 连接超时时间

¥The Connect Timeout

  • 请求超时

¥The Request Timeout

  • 连接应使用的 TDS 版本

¥The TDS Version the connection should use

要设置数据库连接:

¥To set up the database connection:

  1. 输入 SQL Server 主机名作为服务器。在现有的 SQL Server 连接中,主机名位于实例名称之前,格式为 HOSTNAME\INSTANCENAME。查找主机名:

¥Enter the SQL Server Host Name as the Server. In an existing SQL Server connection, the host name comes before the instance name in the format HOSTNAME\INSTANCENAME. Find the host name:

  1. 输入 SQL Server 实例名称作为数据库名称。使用与查找主机名相同的步骤查找此名称。

¥Enter the SQL Server Instance Name as the Database name. Find this name using the same steps listed above for finding the host name.

  • 如果你在这些位置看不到实例名称,则表示你的数据库使用默认的 MSSQLSERVER 实例名称。

    ¥If you don't see an instance name in any of these places, then your database uses the default MSSQLSERVER instance name.

  1. 请输入你的用户账户名或 ID。

¥Enter your User account name or ID.

  1. 请输入你的密码。

¥Enter your Password.

  1. 对于端口:

¥For the Port:

  • SQL Server 默认使用 1433 端口。

    ¥SQL Server defaults to 1433.

  • 如果你无法通过端口 1433 连接,请检查 错误日志 中是否包含短语 Server is listening on,以确定你应该输入的端口号。

    ¥If you can't connect over port 1433, check the Error logs for the phrase Server is listening on to identify the port number you should enter.

  1. 只有当多个域中的用户访问你的数据库时,才需要输入域名。运行以下 SQL 查询以获取域名:

¥You only need to enter the Domain name if users in multiple domains access your database. Run this SQL query to get the domain name:

1
SELECT DEFAULT_DOMAIN()[DomainName];
  1. 选择是否使用 TLS。

¥Select whether to use TLS.

  1. 选择是否忽略 SSL 问题:如果启用,即使 SSL 证书验证失败,凭据也会连接。

¥Select whether to Ignore SSL Issues: If turned on, the credential will connect even if SSL certificate validation fails.

  1. 输入连接超时时间(毫秒数),即 n8n 尝试建立初始连接完成的超时时间(毫秒数)。更多信息,请参阅 SqlConnection.ConnectionTimeout 属性文档

¥Enter the number of milliseconds n8n should attempt the initial connection to complete before disconnecting as the Connect Timeout. Refer to the SqlConnection.ConnectionTimeout property documentation for more information.

  • SQL Server 将此超时时间存储为秒,而 n8n 将其存储为毫秒。如果你要复制 SQL Server 的默认设置,请先将数值乘以 100,然后再在此处输入。

    ¥SQL Server stores this timeout as seconds, while n8n stores it as milliseconds. If you're copying your SQL Server defaults, multiple by 100 before entering the number here.

  1. 输入请求超时时间(毫秒数),即 n8n 等待给定请求的超时时间(毫秒数)。这本质上是一个查询超时参数。有关更多信息,请参阅 排查查询超时错误

    ¥Enter the number of milliseconds n8n should wait on a given request before timing out as the Request Timeout. This is basically a query timeout parameter. Refer to Troubleshoot query time-out errors for more information.

  2. 从“TDS 版本”下拉列表中选择要使用的表格数据流 (TDS) 协议。如果服务器不支持你在此处选择的版本,则连接将使用协商的备用版本。有关 TDS 版本与不同 SQL Server 版本和 .NET 框架兼容性的更详细信息,请参阅 附录 A:产品行为。选项包括:

    ¥Select the Tabular Data Stream (TDS) protocol to use from the TDS Version dropdown. If the server doesn't support the version you select here, the connection uses a negotiated alternate version. Refer to Appendix A: Product Behavior for a more detailed breakdown of the TDS versions' compatibility with different SQL Server versions and .NET frameworks. Options include:

    • 7_4 (SQL Server 2012 ~ 2019):TDS 版本 7.4

    ¥7_4 (SQL Server 2012 ~ 2019): TDS version 7.4.

    • 7_3_B (SQL Server 2008R2):TDS 版本 7.3.B

    ¥7_3_B (SQL Server 2008R2): TDS version 7.3.B.

    • 7_3_A (SQL Server 2008):TDS 版本 7.3.A

    ¥7_3_A (SQL Server 2008): TDS version 7.3.A.

    • 7_2 (SQL Server 2005):TDS 版本 7.2

    ¥7_2 (SQL Server 2005): TDS version 7.2.

    • 7_1 (SQL Server) 2000):TDS 版本 7.1

    ¥7_1 (SQL Server 2000): TDS version 7.1.