For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cannot rename the table because it is published for replication

Beim Aktualisieren einer Devolutions Server-Datenquelle mit aktivierter SQL Server-Replikation wird die folgende Fehlermeldung zurückgegeben:

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

Lösung

  1. Führen Sie diese SQL-Abfrage aus und prüfen Sie, ob sie 1038 zurückgibt:

SELECT DatabaseVersion FROM dbo.DatabaseInfo
  1. Wenn sie 1038 zurückgibt, führen Sie diese Abfrage aus:

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
  1. Starten Sie die Aktualisierung der Datenquelle erneut.

Zuletzt aktualisiert

War das hilfreich?