> 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/it/knowledge-base/troubleshooting-articles/sql-server-connection-timeout.md).

# Timeout di connessione a SQL Server

I timeout di connessione con un SQL Server possono assumere molte forme. Ecco alcune tra le più comuni:

`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;`

Consulti l'elenco completo degli errori in [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).

### Soluzione 1

Per risolvere questo problema, il primo approccio da considerare è [aumentare il timeout di connessione](/rdm/it/getting-started/workspaces/workspace-types/alternative-workspaces/microsoft-sql-server.md#advanced).

1. In Remote Desktop Manager, vada su ***File – Spazi di lavoro*** e modifichi il suo spazio di lavoro Microsoft SQL Server facendo clic sull'icona ***Modifica spazio di lavoro***.
2. Nella scheda ***Avanzate***, aumenti il ritardo di ***Timeout di connessione***.
3. Salvi le modifiche.

### Soluzione 2

Se la modifica della durata del timeout di connessione non ha risolto il problema, verifichi le impostazioni del firewall. SQL Server opera su porte dinamiche, il che richiede che le porte appropriate siano aperte per una comunicazione fluida tra Remote Desktop Manager e il suo SQL Server. Per sapere quali porte abilitare, consulti la sezione "Ports used by the Database Engine" in [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).

### Soluzione 3

Se continua a riscontrare problemi di timeout di connessione, la causa principale potrebbe essere legata al SQL Listener o ai gruppi di disponibilità. In questi casi, provi a impostare il valore ***MultiSubnetFailover*** su ***True***.

1. In Remote Desktop Manager, vada su ***File – Spazi di lavoro*** e modifichi il suo spazio di lavoro Microsoft SQL Server facendo clic sull'icona ***Modifica spazio di lavoro***.
2. Nella scheda ***Avanzate***, faccia clic su ***Altre impostazioni***.
3. Cerchi l'impostazione MultiSubnetFailover e imposti il suo valore su ***True***.

   <div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>Si consiglia di utilizzare <em><strong>Failover Partner</strong></em> oppure <em><strong>MultiSubnetFailover</strong></em>, non entrambi contemporaneamente. Si assicuri che il valore <em><strong>Failover Partner</strong></em> sia vuoto.</p></div>
4. Faccia clic su ***OK***, poi salvi le modifiche.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Consulti questo articolo Microsoft per maggiori informazioni: <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>

### Soluzione 4

[Problemi di convalida del certificato](/rdm/it/knowledge-base/troubleshooting-articles/unable-to-connect-to-the-workspace.md).

### Altre possibili soluzioni

Se le soluzioni sopra indicate non hanno risolto il problema, ulteriori possibili correzioni sono disponibili nei seguenti articoli 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)

Non esiti a [contattare il nostro team di assistenza clienti](mailto:service@devolutions.net) per ulteriore supporto.


---

# 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/it/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.
