marcingminski / sqlwatch

SQL Server Performance Monitor
https://docs.sqlwatch.io
Other
436 stars 173 forks source link

Primary Key Violation #422

Open 3ricb4nk opened 3 years ago

3ricb4nk commented 3 years ago

Violation of PRIMARY KEY constraint 'pk_sqlwatch_logger_perf_procedure_stats'. I get this error on a brand new installation when the SQLWATCH-LOGGER-PROCS job tries to run. From the very first time.

marcingminski commented 3 years ago

what version?

marcingminski commented 3 years ago

Are you able to run the code from the procedure in a way that will show you the dataset in the SSMS so we can understand where the violation is coming from?

3ricb4nk commented 3 years ago

Sorry, version is 4.3.0.23725.20210721131116

3ricb4nk commented 3 years ago

I can run the proc so that it returns a result set, yes. What format would you like it saved to?

marcingminski commented 3 years ago

CSV, XLS, whatever is easier for you.

3ricb4nk commented 3 years ago

Here's an excel version of the results that usp_sqlwatch_logger_procedure_stats returns. The error from sqlagent is this:

Executed as user: DCSDK12\sqlsvrsvc. Violation of PRIMARY KEY constraint 'pk_sqlwatch_logger_perf_procedure_stats'. Cannot insert duplicate key in object 'dbo.sqlwatch_logger_perf_procedure_stats'. The duplicate key value is (ITS-SQLCLUS\SQLCLUSDEV, 14, 317, 2021-10-21 21:30:31, 27, Oct 19 2021 8:06PM). [SQLSTATE 23000] (Error 2627). The step failed SQLWatch_Logger_Procedure_Stats.xlsx .

marcingminski commented 3 years ago

Thanks, let me review and I will come back to you

3ricb4nk commented 3 years ago

Many thanks.

3ricb4nk commented 3 years ago

Any ideas, thoughts, comments?

marcingminski commented 3 years ago

Hi, apologies, swamped with other priorities. It's still on my to do list.

diegoalexander59 commented 6 months ago

Hello @marcingminski. By any chance this error still has no solution?