Network Management

Failed Execution of 'Summarize hourly data [VoipOperationResults] Violation of PRIMARY KEY constraint 'PK_VoipOperationResultHealthStats_Daily'. Cannot insert duplicate key in object 'dbo.VoipOperationResultHealthStats_Daily'."

This article addresses an issue encountered during database maintenance where summarizing hourly data for VoIP operation results fails.

First published date

1/17/2024 9:47 PM

Last published date

12/17/2025 4:45 PM

Overview

During the execution of database maintenance, specifically the procedure dbm_VoipOperationResults_Summary, users may encounter errors in the swdebugMaintenance.log file. 

Error message similar to this

ERROR: SolarWinds.Data.DatabaseMaintenance.StandardTableHandlerDAL - Failed to execute procedure: dbm_VoipOperationResults_Summary System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_VoipOperationResultHealthStats_Daily'. Cannot insert duplicate key in object 'dbo.VoipOperationResultHealthStats_Daily'. The duplicate key value is (Month Day Year Time, XXX, X). The statement has been terminated.

Product section

VoIP & Network Quality Manager

Cause

This issue occurs due to duplicate entries exist in VNQM data, either in the source or destination table.

Resolution

To resolve this issue, please upgrade to SolarWinds Platform 2024.2 and above.

Important! Before proceeding, ensure you have a recent backup of your SolarWinds Platform database.
  1. Download Script: Download the script from this [link ].
  2. Backup Stored Procedure: Using SSMS, save the original version of the stored procedure [dbo].[dbm_VoipOperationResults_Summary] located under SolarWinds DB > Programmability.
  3. Run Script: Using MS SQL Server Management Studio, execute the downloaded script, "80_SP_VoipOperationResults_SummaryFix.sql," on your SolarWinds Platform database.
  4. Run Database Maintenance: Run the database maintenance process again. For detailed instructions, refer to [this article ].
  5. Verify Resolution: Review the Database Maintenance logs located at 'C:\ProgramData\SolarWinds\Logs\Orion\swdebugMaintenance.log' to confirm if the error persists.
 If you encounter any issues or need further information, please open a support case.