Sign in with Microsoft
Sign in or create an account.
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.


Assume that you use transactional replication in Microsoft SQL Server 2008, and there is an update query running on the publication. When you upgrade the SQL Server to SQL Server 2012 or SQL Server 2014, and the update query is not distributed before the upgrade, the Log Reader Agent may fail with the following error:

<Date> <Time> Publisher: {call sp_replcmds (500, 0, 0, , 0, 500000)}
<Date> <Time> Status: 0, code: 20011, text: 'The process could not execute 'sp_replcmds' on '< Publisher Name>'.'.
<Date> <Time> The process could not execute 'sp_replcmds' on '<Publisher Name>'.
<Date> <Time> Repl Agent Status: 6
<Date> <Time> Status: 0, code: 542, text: 'An invalid datetime value was encountered. Value exceeds the year 9999.'.
<Date> <Time> Status: 0, code: 3621, text: 'The statement has been terminated.'.
<Date> <Time> Status: 0, code: 22037, text: 'The process could not execute 'sp_replcmds' on '<Publisher Name>'.'.

Even if this problem has not happened, upgraded log records for update statements can still be misinterpreted by Log Reader Agent and the following error can arise in Distribution Agent:

515 Cannot insert the value NULL into column '<Column Name>', table '<Table Name>'; column does not allow nulls. UPDATE fails.


  • Different data types and constraints can cause different error to be reported, and this problem even can cause non-convergence.

  • The issue occurs when you upgrade from SQL Server 2008 or SQL Server 2008 R2 to SQL Server 2012 or SQL Server 2014.

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!