> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/rdm/es/knowledge-base/troubleshooting-articles/sql-server-connection-timeout.md).

# Tiempo de espera de conexión de SQL Server

Los tiempos de espera de conexión con un SQL Server pueden presentarse de muchas formas. Estos son algunos de los más habituales:

`System.Data.SqlClient.SqlException : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.`

`System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out.`

`Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.)`

`Microsoft.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=5018; handshake=12;`

Consulte la lista completa de errores en [Timeout expired messages when connecting to SQL Server](https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/timeout-expired-error#verify-timeout-expired-errors).

### Solución 1

Para resolver este problema, el primer enfoque que debería considerar es [aumentar el tiempo de espera de conexión](/rdm/es/getting-started/workspaces/workspace-types/alternative-workspaces/microsoft-sql-server.md#advanced).

1. En Remote Desktop Manager, vaya a ***Archivo – Espacios de trabajo*** y edite su espacio de trabajo de Microsoft SQL Server haciendo clic en el icono ***Editar espacio de trabajo***.
2. En la pestaña ***Avanzado***, aumente el retardo de ***Tiempo de espera de conexión***.
3. Guarde los cambios.

### Solución 2

Si ajustar la duración del tiempo de espera de conexión no resolvió el problema, revise la configuración de su cortafuegos. SQL Server funciona con puertos dinámicos, por lo que es necesario que los puertos correspondientes estén abiertos para que la comunicación entre Remote Desktop Manager y su SQL Server sea fluida. Para saber qué puertos habilitar, consulte la sección "Ports used by the Database Engine" en [Configure the Windows Firewall to allow SQL Server access](https://learn.microsoft.com/en-us/sql/sql-server/install/configure-the-windows-firewall-to-allow-sql-server-access?view=sql-server-ver16#ports-used-by-the-database-engine).

### Solución 3

Si sigue experimentando problemas de tiempo de espera de conexión, la causa raíz podría estar relacionada con el SQL Listener o los grupos de disponibilidad. En tales casos, pruebe a establecer el valor ***MultiSubnetFailover*** en ***True***.

1. En Remote Desktop Manager, vaya a ***Archivo – Espacios de trabajo*** y edite su espacio de trabajo de Microsoft SQL Server haciendo clic en el icono ***Editar espacio de trabajo***.
2. En la pestaña ***Avanzado***, haga clic en ***Más configuraciones***.
3. Busque la configuración MultiSubnetFailover y establezca su valor en ***True***.

   <div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>Se recomienda utilizar <em><strong>Failover Partner</strong></em> o <em><strong>MultiSubnetFailover</strong></em>, pero no ambos simultáneamente. Asegúrese de que el valor de <em><strong>Failover Partner</strong></em> esté vacío.</p></div>
4. Haga clic en ***OK*** y luego guarde los cambios.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Consulte este artículo de Microsoft para obtener más información: <a href="https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/availability-groups/listener-connection-times-out">Timeout occurs when you connect to an Always On listener in multi-subnet environment</a>.</p></div>

### Solución 4

[Problemas de validación de certificados](/rdm/es/knowledge-base/troubleshooting-articles/unable-to-connect-to-the-workspace.md).

### Otras posibles soluciones

Si las soluciones mencionadas anteriormente no han resuelto el problema, puede encontrar otras posibles correcciones en los siguientes artículos de Microsoft:

* [Timeout expired messages when connecting to SQL Server](https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/timeout-expired-error)
* [A network-related or instance-specific error occurred while establishing a connection to SQL Server](https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/network-related-or-instance-specific-error-occurred-while-establishing-connection)

No dude en [contactar con nuestro equipo de atención al cliente](mailto:service@devolutions.net) para obtener más ayuda.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/rdm/es/knowledge-base/troubleshooting-articles/sql-server-connection-timeout.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
