tigertoolbox icon indicating copy to clipboard operation
tigertoolbox copied to clipboard

Error 515 has occurred. Message: Cannot insert the value NULL into column 'objectID',

Open d-moloney opened this issue 6 years ago • 3 comments

I am getting errors on a few database servers. Error 515 has occurred. Message: Cannot insert the value NULL into column 'objectID', table 'Tools.dbo.tbl_AdaptiveIndexDefrag_Stats_log'; column does not allow nulls. INSERT fails. (Line Number: 2446)

i am running EXECUTE [dbo].[usp_AdaptiveIndexDefrag] @ignoreDropObj = 1 I also get the error just running EXECUTE [dbo].[usp_AdaptiveIndexDefrag]

d-moloney avatar Mar 06 '18 19:03 d-moloney

Which version, edition and build of SQL Server is this? https://github.com/Microsoft/tigertoolbox/issues/76 seems to be the same issue.

rabryst avatar Mar 28 '18 19:03 rabryst

Hi, I don't know if it can help, but I got this kind of issue when a first execution failed, ie when the user hasn't permission to access a sys object. In this case, some lines stayed in tbl_AdaptiveIndexDefrag_Working, and if I try to launch again de program with the good user, I got this error : Error 515 has occurred. Message: Cannot insert the value NULL into column 'statsID', table 'dbo.tbl_AdaptiveIndexDefrag_Stats_log'; column does not allow nulls. INSERT fails. (Line Number: 2158)

Same message but different column. To solve it, I just truncated tbl_AdaptiveIndexDefrag_Working, and execute the program and it works fine.

Regards,

patiramet avatar Jun 11 '18 07:06 patiramet

When such happens, given I couldn't repro, a database backup, if shareable, helps to debug. I can provide a secure upload in case you are allowed to share for the purpose of debugging.

pmasl avatar Oct 29 '18 02:10 pmasl