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

# Timeout for SQL Server-forbindelse

Ret timeoutfejl for SQL Server-forbindelser i Remote Desktop Manager ved at øge timeoutværdier, åbne firewallporte eller aktivere MultiSubnetFailover.

Timeout for forbindelser til en SQL Server kan optræde på mange måder. Her er nogle af de mest almindelige:

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

Se den fulde liste over fejl i [Meddelelser om udløbet timeout ved forbindelse til SQL Server](https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/timeout-expired-error#verify-timeout-expired-errors).

### Løsning 1

For at håndtere problemet bør De først overveje at [øge forbindelsestimeouten](/rdm/da/getting-started/workspaces/workspace-types/alternative-workspaces/microsoft-sql-server.md#advanced).

1. I Remote Desktop Manager skal De gå til ***Fil – Arbejdsområder*** og redigere Deres Microsoft SQL Server-arbejdsområde ved at klikke på ikonet ***Rediger arbejdsområde***.
2. På fanen ***Avanceret*** skal De øge forsinkelsen for ***Forbindelsestimeout***.
3. Gem ændringerne.

### Løsning 2

Hvis justering af forbindelsestimeouten ikke løste problemet, skal De kontrollere firewallindstillingerne. SQL Server bruger dynamiske porte, og de relevante porte skal være åbne, så Remote Desktop Manager og SQL Server kan kommunikere. Se afsnittet "Porte, der bruges af Database Engine" i [Konfigurer Windows Firewall til at tillade SQL Server-adgang](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) for at få vejledning om, hvilke porte der skal aktiveres.

### Løsning 3

Hvis De fortsat oplever timeout for forbindelsen, kan den grundlæggende årsag hænge sammen med SQL-lytteren eller tilgængelighedsgrupper. I sådanne tilfælde kan De prøve at sætte værdien ***MultiSubnetFailover*** til ***True***.

1. I Remote Desktop Manager skal De gå til ***Fil – Arbejdsområder*** og redigere Deres Microsoft SQL Server-arbejdsområde ved at klikke på ikonet ***Rediger arbejdsområde***.
2. På fanen ***Avanceret*** skal De klikke på ***Flere indstillinger***.
3. Søg efter indstillingen MultiSubnetFailover, og sæt værdien til ***True***.

   <div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>Det anbefales at bruge enten <em><strong>Failover Partner</strong></em> eller <em><strong>MultiSubnetFailover</strong></em>, ikke begge samtidig. Sørg for, at værdien for <em><strong>Failover Partner</strong></em> er ryddet.</p></div>
4. Klik på ***OK***, og gem derefter ændringerne.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Se denne Microsoft-artikel for at få flere oplysninger: <a href="https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/availability-groups/listener-connection-times-out">Der opstår timeout, når De opretter forbindelse til en Always On-lytter i et miljø med flere undernet</a>.</p></div>

### Løsning 4

[Problemer med certifikatvalidering](/rdm/da/knowledge-base/troubleshooting-articles/unable-to-connect-to-the-workspace.md).

### Andre mulige løsninger

Hvis løsningerne ovenfor ikke har løst problemet, findes der flere mulige rettelser i følgende Microsoft-artikler:

* [Meddelelser om udløbet timeout ved forbindelse til SQL Server](https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/timeout-expired-error)
* [Der opstod en netværksrelateret eller instansspecifik fejl under oprettelse af en forbindelse til SQL Server](https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/network-related-or-instance-specific-error-occurred-while-establishing-connection)

De er velkomne til at [kontakte vores kundesupportteam](mailto:service@devolutions.net) for at få yderligere hjælp.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
