Microsoft Edge Try Microsoft Edge A fast and secure browser that's designed for Windows 10 Get started

This site uses cookies for analytics, personalized content and ads. By continuing to browse this site, you agree to this use. Learn more
Skip to main content
Microsoft
Microsoft Support
  • Office
  • Windows
  • Surface
  • Xbox
  • Deals
  • Support
      • Windows apps
      • OneDrive
      • Outlook
      • Skype
      • OneNote
      • PCs & tablets
      • Accessories
      • Microsoft HoloLens
      • Xbox games
      • PC games
      • Windows digital games
      • Movies & TV
      • Microsoft Azure
      • Microsoft Dynamics 365
      • Microsoft 365
      • Cloud platform
      • Enterprise solutions
      • Data platform
      • .NET
      • Visual Studio
      • Windows Dev Center
      • Docs
      • Free downloads & security
      • Education
      • Gift cards
    • View all
    0
    Sign in
    Microsoft Support

    FIX: The change table is ordered incorrectly for updated rows after you enable change data capture for a Microsoft SQL Server database

    Content provided by Microsoft

    Content provided by Microsoft

    Applies to: SQL Server 2008 EnterpriseMicrosoft SQL Server 2014 Service Pack 1SQL Server 2014 DeveloperSQL Server 2014 DeveloperSQL Server 2014 EnterpriseSQL Server 2014 EnterpriseSQL Server 2014 StandardSQL Server 2014 StandardSQL Server 2012 DeveloperSQL Server 2012 EnterpriseSQL Server 2012 Enterprise CoreSQL Server 2012 StandardSQL Server 2016 DeveloperSQL Server 2016 EnterpriseSQL Server 2016 Enterprise CoreSQL Server 2016 StandardMicrosoft SQL Server 2016 Service Pack 1 More



    Microsoft distributes Microsoft SQL Server 2012, 2014 or 2016 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012, 2014, 2016 fix release.

    Symptoms


    After you enable change data capture for a Microsoft SQL Server 2012 ,2014 or 2016 database, the __$operation column in the change table may be ordered incorrectly for updated rows. When you update a row, there are two rows in the change table, with delete and insert for __$operation. But an insert operation may unexpectedly appear before a delete operation. If the application reapplies the rows to another table with a primary key constraint, the following primary key violation may occur:
     
    Msg 2627, Level 14, State 1, Line 6Violation of PRIMARY KEY constraint 'Primary_Key_name'. Cannot insert duplicate key in object 'table_name'. The duplicate key value is (value).

    Resolution


    This issue is fixed in the following cumulative updates of SQL Server.

     
    • Cumulative Update 5 for SQL Server 2016 RTM
    • Cumulative Update 2 for SQL Server 2016 SP1
    • Cumulative Update 4 for SQL Server 2014 SP2
    • Cumulative Update 10 for SQL Server 2014 SP1
    • Cumulative Update 9 for SQL Server 2014
    • Cumulative Update 8 for SQL Server 2012 SP3
    • Cumulative Update 7 for SQL Server 2012 SP2
     
    Recommendation: Install the latest cumulative updates for SQL Server
    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:
     
    • Latest cumulative update for SQL Server 2016
    • Latest cumulative update for SQL Server 2014
    • Latest cumulative update for SQL Server 2012 SP3
    • Latest cumulative update for SQL Server 2012 SP2

    Status


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

    References


    Learn about the terminology that Microsoft uses to describe software updates.

    Last Updated: 21 Mar 2017
    • Email
    • Print
    Thanks! Your feedback will help us improve the support experience.

    Support

    Support

    • Find downloads
    • Account support
    • Supported products list
    • Microsoft Lifecycle Policy

    Security

    Security

    • Safety & Security Center
    • Download Security Essentials
    • Malicious Software Removal Tool

    Contact us

    Contact us

    • Report a support scam
    • Contact Microsoft Support
    • Privacy questions
    • Locate Microsoft addresses worldwide
    This site in other countries/regions
    Algérie - Français
    Argentina - Español
    Australia - English
    Belgique - Français
    België - Nederlands
    Bolivia - Español
    Bosna i Hercegovina - Hrvatski
    Brasil - Português
    Canada - English
    Canada - Français
    Chile - Español
    Colombia - Español
    Costa Rica - Español
    Crna Gora - Srpski
    Danmark - Dansk
    Deutschland - Deutsch
    Dominican Republic - Español
    Ecuador - Español
    Eesti - Eesti
    El Salvador - Español
    España - Español
    Estados Unidos - Español
    France - Français
    Guatemala - Español
    Hong Kong SAR - English
    Hrvatska - Hrvatski
    India - English
    Indonesia (Bahasa) - Bahasa
    Ireland - English
    Italia - Italiano
    Latvija - Latviešu
    Lietuva - Lietuvių
    Luxembourg - Français
    Magyarország - Magyar
    Malaysia - English
    Maroc - Français
    México - Español
    Nederland - Nederlands
    New Zealand - English
    Norge - Bokmål
    Panamá - Español
    Paraguay - Español
    Perú - Español
    Philippines - English
    Polska - Polski
    Portugal - Português
    Puerto Rico - Español
    România - Română
    Schweiz - Deutsch
    Singapore - English
    Slovenija - Slovenščina
    Slovensko - Slovenčina
    South Africa - English
    Srbija - Srpski
    Suisse - Français
    Suomi - Suomi
    Sverige - Svenska
    Tunisie - Français
    Türkiye - Türkçe
    United Kingdom - English
    United States - English
    Uruguay - Español
    Venezuela - Español
    Việt Nam - Tiếng việt
    Ísland - Íslenska
    Österreich - Deutsch
    Česká Republika - Čeština
    Ελλάδα - Ελληνικά
    България - Български
    Казахстан - Русский
    Россия - Русский
    Україна - Українська
    ישראל - עברית
    الإمارات العربية المتحدة - العربية
    المملكة العربية السعودية - العربية
    مصر - العربية
    भारत - हिंदी
    ไทย - ไทย
    中国 - 简体中文
    台灣 - 繁體中文
    日本 - 日本語
    香港特別行政區 - 繁體中文
    대한민국 - 한국어
    English (Ireland)
    • Terms of use
    • Privacy & cookies
    • Trademarks
    • © Microsoft 2018