5 Replies Latest reply on Jul 31, 2009 1:16 PM by bshopp

    Database maintenance

      My daily database maintenance is full errors like the following:

      I am unable to trucate the tables with the error.  The data in the tables are old and not being updated. 

      2009-07-31 02:58:55,443 [1] ERROR SolarWinds.Data.DatabaseMaintenance.StandardTableHandlerDAL - Failed to execute procedure: NPM_HST_WL_DetailToHourly
      System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_NPM_NV_WL_APS_HOURLY'. Cannot insert duplicate key in object 'dbo.NPM_NV_WL_APS_HOURLY'.
         at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
         at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
         at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
         at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
         at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
         at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
         at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
         at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
         at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
         at SolarWinds.Data.DatabaseMaintenance.StandardTableHandlerDAL.InternalExecuteStoredProc(String procedureName, SqlParameter[] parameters)