I have a corrupted database with the following error
Msg 8952, Level 16, State 1, Line 1
Table error: table 'sys.syscolpars' (ID 41). Index row of index 'nc' (ID 2) does not match any row of data. Additional or invalid keys for:
Msg 8956, Level 16, State 1, Line 1
Index row (1:96551:30) with values (id = 1059235274 and name = 'binary_message_body' and number = 0 and colid = 15) pointing to the row of data identified by (id = 1059235274 and number = 0 and colon = 15).
Msg 8952, Level 16, State 1, Line 1
Table error: table 'sys.syscolpars' (ID 41). Index row of index 'nc' (ID 2) does not match any row of data. Additional or invalid keys for:
Msg 8956, Level 16, State 1, Line 1
Index row (1:96551:32) with values (id=1059235274 and name='conversation_handle' and number=0 and colid=5) pointing to data row identified by (id=1059235274 and number=0 and package = 5).
I've been advised to restore from a non-corrupted backup. The problem is that the most recent one dates several weeks back. There are some later full backups, but they already have that consistency error. Could I somehow get the differential backup between the stable backup and my latest version? I have tried to do it using Microsoft SQL Server Management Studio on a Windows Server 2019, but I think it contains the difference with to the last created backup (which already contains corrupted data) and I don't know how to find the difference between the stable backup and the data that I currently have.
Is there a way to delete specific backups so it considers the stable backup as the latest one?
I'm using this version:
Microsoft SQL Server 2019 (RTM-CU15) (KB5008996) - 15.0.4198.2 (X64) Jan 12 2022 22:30:08 Copyright (C) 2019 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor)
MERGE
statements for every table which compare by primary key and add, delete or update any rows needed. Probably better to start with straight copies of whatever you have. SSMS Import/Export Wizard might be a good place to start, there are others also. If any table fails then do aMERGE
over a backup. Don't forget to copy all view, function, procedure and type definitions, as well as indexes, and any management data like certificates and users