Legi0n


I'm running SQL Server 2005 SP2 64bit under Windows Server 2003 64 bit
The system is the replication distributor as well. Transactional replication.

But I can't create the snapshot!

I have run snapshot.exe repeteadly with all parameters in a command prompt and it crashes at various BCP percentages.
The error is like this:
2007-10-16 00:38:56.32 [10%] Bulk copied snapshot data for article 'Dictionary (part 14 of 20)' (1656 rows).
2007-10-16 00:38:56.32 [10%] The replication agent had encountered an exception.
2007-10-16 00:38:56.32 Source: Replication
2007-10-16 00:38:56.32 Exception Type: Microsoft.SqlServer.Replication.NativeSqlConnectionException
2007-10-16 00:38:56.32 Exception Message: Data conversion failed
2007-10-16 00:38:56.32 Message Code: 02007-10-16 00:38:56.32
2007-10-16 00:38:56.32 Call Stack:
2007-10-16 00:38:56.32 Microsoft.SqlServer.Replication.NativeSqlConnectionException: Data conversion failed
2007-10-16 00:38:56.32 at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
2007-10-16 00:38:56.32 at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strBaseBcpObjectName, Boolean fUnicodeConversion, String strDataFile, String strLoadOrderingHint, String strWhereClause)
2007-10-16 00:38:56.32 at Microsoft.SqlServer.Replication.Snapshot.SqlServer.BcpOutThreadProvider.DoWork(WorkItem workItem)
2007-10-16 00:38:56.32 at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
2007-10-16 00:38:56.32 at Microsoft.SqlServer.Replication.MainWorkerThread.AgentThreadProc()
2007-10-16 00:38:56.32 at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper()
2007-10-16 00:38:56.33 [10%] Bulk copied snapshot data for article 'Dictionary (part 15 of 20)' (1487 rows).
2007-10-16 00:38:56.33 [10%] Bulk copying snapshot data for article 'Dictionary (part 20 of 20)'

the fact that BCP continues to copy data after the error makes me believe the crash occurs somewhere else.

How can I isolate the offending table
Can I capture the BCP commands issued

Any insight will be appreciated.




Re: SQL2005 64bit, snapshot creation error

Legi0n


I think I made some progress:
By changing the snapshot format to character, things go on up to 98%
Then I get Exception Message: StartIndex cannot be less than zero. Now I'm stumped.
What does that mean
And more important, how do I get past it

2007-10-16 03:55:52.41 [98%] The replication agent had encountered an exception.
2007-10-16 03:55:52.41 Source: Replication
2007-10-16 03:55:52.41 Exception Type: Microsoft.SqlServer.Replication.ReplicationAgentSqlException
2007-10-16 03:55:52.41 Exception Message: StartIndex cannot be less than zero.
2007-10-16 03:55:52.41 Parameter name: startIndex
2007-10-16 03:55:52.41 Message Code: 52006
2007-10-16 03:55:52.41
2007-10-16 03:55:52.41 Call Stack:
2007-10-16 03:55:52.41 Microsoft.SqlServer.Replication.ReplicationAgentSqlException: StartIndex cannot be less than zero.
2007-10-16 03:55:52.41 Parameter name: startIndex ---> System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
2007-10-16 03:55:52.41 Parameter name: startIndex
2007-10-16 03:55:52.41 at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.ProcessGetObjectScriptResult(SqlDataReader dataReader)
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32 queryTimeout, CommandBehavior commandBehavior)

2007-10-16 03:55:52.41 --- End of inner exception stack trace ---
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32 queryTimeout, CommandBehavior commandBehavior)

2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, CommandBehavior commandBehavior)
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.Script()
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateNonTableArticleSchScript(Scripter scripter, BaseArticleWrapper articleWrapper, SqlSmoObject smoObject, Boolean quotedIdentifierOn, Boolean ansiNullsOn, Boolean textMode)
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateStoredProcedureArticleScripts(ArticleScriptingBundle articleScriptingBundle)
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
2007-10-16 03:55:52.41 at Microsoft.SqlServer.Replication.AgentCore.Run()
2007-10-16 03:56:10.18 [98%] ********************************************************************************
2007-10-16 03:56:10.18 The replication agent had encountered an unexpected exception, a memory dump
2007-10-16 03:56:10.18 containing information about the exception has been generated at the following
2007-10-16 03:56:10.18 location:
2007-10-16 03:56:10.18
2007-10-16 03:56:10.18 C:\Program Files\Microsoft SQL Server\90\Shared\ErrorDumps\ReplAgent_20071015205524.mdmp
2007-10-16 03:56:10.18
2007-10-16 03:56:10.18 ********************************************************************************





Re: SQL2005 64bit, snapshot creation error

Legi0n

adding -VerbatimTextObjectScripting 0 did the trick