MM12345


I have set up transactional replication with immediate updating subscriptions on my test SQL 2005 servers. One of the snapshot agents failed with "Specified cast is not valid" error message. I have created the subscription for that database by initializing it from backup instead. I would like to find out why this snapshot agent is failing and how to fix it.
SQL Server 2005 Standard Edition SP2, Windows Server 2003 R2 64-bit, SP2.

Error messages:

Source: Microsoft.SqlServer.Replication
Target Site: Int64 ExtractInt16RangeHighKeyValueAsInt64(StepInfo)
Message: Specified cast is not valid.
Stack: at Microsoft.SqlServer.Replication.Snapshot.SqlServer.ArticleBcpPartitioningResolver.ExtractInt16RangeHighKeyValueAsInt64(StepInfo stepInfo)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.ArticleBcpPartitioningResolver.InterpolateStepInfos(Int32 targetNumberOfPartitions)
at Microsoft.SqlServer.Replication.Snapshot.SqlServer.ArticleBcpPartitioningResolver.ResolveArticleBcpPartitioningUsingKeyDistributionHistogram(BaseArticleWrapper article, Boolean usePrimaryKeyOnly)
at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: Microsoft.SqlServer.Replication, Error number: 0)
Get help: http://help/0

Thanks for your help.