Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

SWITCH table partition failure

$
0
0

Hi,

I am getting a sql error during DDL change to a table. The following statement is executed on SQL server 2008 R2 SP2 database which is enabled for replication:

:CONNECT PublisherServer
GO
USE MyProfile
GO
declare @PurgePartition int =5
alter table DBAAdmin.PersonCoreAudit switch partition @PurgePartition to DBAAdmin.PersonCoreAudit_PartitionSwitch partition @PurgePartition

--Both tables DBAAdmin.PersonCoreAudit and DBAAdmin.PersonCoreAudit_PartitionSwitch have the same structure, partition key  and are not replicated.

Error:
"

Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@PurgePartition".
Msg 3609, Level 16, State 2, Line 3
The transaction ended in the trigger. The batch has been aborted."

It obvious that error is thrown inside replication system routines.  I would appreciate if someone can help to understand this failure and fix this issue.

Thanks,
Valerij



Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>