> 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/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

Updating a Devolutions Server workspace with SQL Server Replication enabled returns the following error message:

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

### Solution

1. Run this SQL query and see if it returns 1038:

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

2. If it does return 1038, then run this query:

```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. Start the workspace update once again.


---

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