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
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
8,572 questions
No comments
1 vote

Accepted answer
  1. Erland Sommarskog 68,206 Reputation points Microsoft MVP
    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.


2 additional answers

Sort by: Most helpful
  1. YufeiShao-msft 6,871 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.


  2. 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.

    No comments