Jump to content

tester22

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by tester22

  1. Hi,

     

    Managed to solve it.

    If the archiving service crashes while copyting data from audit to auditarchive tables it creates conflicts and the process crashes.

     

    After removing the primarykey from auditarchive the archiving works as expected but I am getting duplicates.

    The running:

     

    WITH cte AS (SELECT[AuditID], [UserID], 2 row_number() OVER(PARTITION BY AuditID, UserID ORDER BY AuditID) AS [rn] 3 FROM [passwordstate].[dbo].[AuditingArchive] 4 )DELETE cte WHERE [rn] > 1

     

    Cleans the table and I could re-enable the primary key in the archiving table.

     

     

     

×
×
  • Create New...