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

'Expired subscription clean up' sql agent job is failing

$
0
0

'Expired subscription clean up' sql agent job is failing

Message is:

DELETE failed because the following SET options have incorrect settings: 'ANSI_NULLS,QUOTED_IDENTIFIER, ARITHABORT'. Verify that SET options are correct for use with indexedviews and/or indexes on computed columns and/or query notifications and/or xml data typemethods.

Msg 20709, Level 16, State 1, Procedure sp_MScleanup_conflict, Line 66

The merge process could not clean up the conflict table "[MSmerge_conflict_CtelAthData_Publication_SalesAreaRegionPrice]" for publication"CtelAthData_Publication".

I can cure the ARITHABORT issue by adding a statement BEFORE the call to

sp_expired_subscription_cleanup:

SET ARITHABORT ON

However, I am unable to cure problems with ANSI_NULLS and QUOTED_IDENTIFIER in this manner.   Sp_MScleanup_conflict, called from sp_expired_subscription_cleanup, is declared with these settings set to OFF, undoing my SET statements???

The particular conflict table mentioned in the message, MSmerge_conflict_CtelAthData_Publication_SalesAreaRegionPrice, related to a replicated table that is defined with two calculated columns, one of which is persisted:

CREATE TABLE [dbo].[SalesAreaRegionPrice](
 [SalesAreaRegionPrice_ID] [nvarchar](32) NOT NULL,
 [SalesArea_ID] [nvarchar](32) NULL,
 [ExchangeRateType_ID] [nvarchar](32) NOT NULL,
 [StartDate]  AS (dateadd(day,(1),dateadd(year,(-1),[EndDate]))) PERSISTED,
 [EndDate] [datetime] NOT NULL,
 [CurrencyCode] [nvarchar](8) NOT NULL,
 [PriceList_ID] [nvarchar](32) NULL,
 [IsBasePrice]  AS (case when [PriceList_ID] IS NULL then (-1) else (0) end),
 CONSTRAINT [PK_SalesAreaRegionPrice] PRIMARY KEY CLUSTERED
(
 [SalesAreaRegionPrice_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]


I suspect this may be the only table with calculated columns that we replicate....

There is also the rowguid column that is added automatically by the system. If I check the table's properties then, under 'Replication/Table is replicated' the setting is FALSE.  However, if I check the 'Publication Properties' of 'CtelAthDate_Publication' then table [SalesAreaRegionPrice] is checked and ALL its columns are checked???  ALL columns, EXCEPT the persisted column 'StartDate', have a circled green asterisk besides them.  (What do the circled green asterisks mean???)

We are using merge replication with SQL Server 2005 sp3.   We typically run with sql server 2000 (80) backward compatibility.  However, (temporarily) switching to sql server 2005 (90) does not fix the problem. 

Can I use (merge) replication with calculated columns?   Should I untick the persisted column in the 'Publication Properties'?  Why are this table's (+ others) properties saying there is no replication?   Alas I did not set up the replication.  Am just trying to understand what is going on so I can fix it.

Thanks
Breadon


Viewing all articles
Browse latest Browse all 4054

Trending Articles



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