> 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/server/fr/knowledge-base/troubleshooting-articles/cannot-rename-the-table-because-it-is-published-for-replication.md).

# Cannot rename the table because it is published for replication

La mise à jour d'un espace de travail Devolutions Server avec la réplication SQL Server activée retourne le message d'erreur suivant :

`Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot rename the table because it is published for replication.`

### Solution

1. Exécutez cette requête SQL et vérifiez si elle retourne 1038 :

```sql
SELECT DatabaseVersion FROM dbo.DatabaseInfo
```

2. Si elle retourne bien 1038, exécutez alors cette requête :

```sql
if   exists (select * FROM dbo.DatabaseInfo where DatabaseVersion = 1038)

 AND exists (SELECT  1 FROM sys.indexes i INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id WHERE i.object_id = OBJECT_ID(N'dbo.LogMessage') AND i.name = 'PK_LogMessage' AND c.name = 'ID' AND type_desc = 'CLUSTERED')

BEGIN

	drop table dbo.LogMessage;

END

GO

if   exists (select * FROM dbo.DatabaseInfo where DatabaseVersion = 1038)

 AND exists (SELECT  1 FROM sys.indexes i INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id WHERE i.object_id = OBJECT_ID(N'dbo.LogMessage_Archive') AND i.name = 'PK_LogMessage_Archive' AND c.name = 'ID' AND type_desc = 'CLUSTERED')

BEGIN

	drop table dbo.LogMessage_Archive;

END

GO
```

3. Relancez la mise à jour de l'espace de travail.


---

# 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:

```
GET https://docs.devolutions.net/server/fr/knowledge-base/troubleshooting-articles/cannot-rename-the-table-because-it-is-published-for-replication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
