Share via

SQL Server 2019 - CU 13 Problem with Memory Optimized Table Type

John 26 Reputation points
2021-11-12T17:21:56.64+00:00

I recently installed CU 13 on my test SQL Server 2019 server.

Now, when running CheckDB I'm getting a consistency error with a simple memory optimized table type.

CREATE TYPE [dbo].[ADUserType] AS TABLE(
[UserId] VARCHAR NOT NULL,
[Name] VARCHAR NULL,
PRIMARY KEY NONCLUSTERED (UserId)
)WITH ( MEMORY_OPTIMIZED = ON)
GO

DBCC CHECKDB (MyDatabase) WITH EXTENDED_LOGICAL_CHECKS

"Verified integrity of statistics 'sys.TT_ADUserType_094028A5.PK__TT_ADUse__1788CC4D0F98FE70'. Msg 9122, Level 16, State 201, Line 17 The statistics 'sys.TT_ADUserType_094028A5.PK__TT_ADUse__1788CC4D0F98FE70' is corrupt."

Is this a bug in the update? Or do I need to create the type differently?

Thanks!

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

Answer accepted by question author

Erland Sommarskog 134.1K Reputation points MVP Volunteer Moderator
2021-11-12T23:11:13.68+00:00

Indeed. I get the same issue. I created your type in AdventureWorks2016, which seems to have a few more memory-optimized data types, and they also errored out.

I would guess the issue is in DBCC CHECKDB.

Was this answer helpful?

1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Tomáš Zíka 256 Reputation points
    2022-09-07T10:21:22.197+00:00

    I reproduced the same problem in SQL Server 2019 on Linux (Docker).
    It started in CU13 and was fixed in CU17.

    Was this answer helpful?

    0 comments No comments

  2. YufeiShao-msft 7,156 Reputation points
    2021-11-15T08:20:26.467+00:00

    Hi @John ,

    In CU13 for SQL Sserver2019, corrupt statistics can be detected by using extended_logical_checks as part of DBCC CHECKD, try to update the statistics:
    https://learn.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/statistics-for-memory-optimized-tables?view=sql-server-ver15

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.