sql-server-maintenance-solution icon indicating copy to clipboard operation
sql-server-maintenance-solution copied to clipboard

handling of memory optimized tables gives an error

Open wfvdijk opened this issue 4 years ago • 1 comments

When running indexmaintenance, I got this error: "Msg 41317, Sev 16, State 1, Line 1 : A user transaction that accesses memory optimized tables or natively compiled modules cannot access more than one user database or databases model and msdb, and it cannot write to master. [SQLSTATE 42000]" is it possible to tackle this situation in the indexmaintenance script?

wfvdijk avatar Oct 20 '21 06:10 wfvdijk

@olahallengren Hi, thank you for your wonderful script. I have a question about this. We use SQL 2019 with some memory-optimized tables. It fails with the same error that wfvdijk wrote. I found that if I set SET @PartitionLevelStatistics = 0 in line 1195. all works as planned. I tried to understand the logic but nothing seems reasonable why this param causes this error. Do you have an idea?

TomAgm avatar Nov 28 '22 12:11 TomAgm