SQL Server-提供的统计信息流已损坏

时间:2017-11-09 03:40:47

标签: sql sql-server ssms

我正在尝试将统计信息添加到我已创建的表中。当我试图运行它时,它会抛出一个错误:

  

提供的统计信息流已损坏

这是我对统计数据示例的查询:

IF NOT EXISTS (SELECT * 
               FROM sys.stats 
               WHERE name = N'_WA_Sys_00000027_3C69FB99' 
                 AND object_id = object_id(N'[dbo].[PromotionEvent]'))
    CREATE STATISTICS [_WA_Sys_00000027_3C69FB99] 
        ON [dbo].[PromotionEvent]([CRMCode]) 
        WITH STATS_STREAM = 0x010000000100000000000000000000008B95918100000000C4040000000000008404000000000000E7020000E7000000480000000000000008D0000090D4B94007000000AB7FBA0034A60000BA29000000000000BA290000000000000000803FD9899D3D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B0000000B0000000100000010000000ACB7283D00E8264600E02446ACB7283D000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013000000000000000000000000000000E1020000000000001003000000000000180300000000000058000000000000006B00000000000000AA00000000000000E90000000000000028010000000000006701000000000000A601000000000000E50100000000000024020000000000006302000000000000A202000000000000100010000000EE42000000000000803F040000300010000000803F0000803F0000803F04000001003F00320046003200300043003100350037002D0034003500330044002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00330036003300380043003300300039002D0033003500330044002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00330046003600350039003300440044002D0030003400330044002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00350045003000320030003800460044002D0034004200330044002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00380045003400370044003100310045002D0034003000330044002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00410030003100310033003100330039002D0034004500330044002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00410045003400460037004200440046002D0033003100330044002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00430041003300360044003000340031002D0038003700330043002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00430045003600410039003200320042002D0034003700330044002D0045003600310031002D003800300010000000803F000000000000803F04000001003F00450044004500340043003300310039002D0034003800330044002D0045003600310031002D003800FF010000001A0200002002000002000000280000002800000000000000000000000000000001000000060000000000BA29000000000000
GO

为什么会出现此错误?是因为流太长了吗?我该如何解决? 我必须坚持使用此流,因为我正在进行数据存档,因此统计信息必须具有相似的名称。

由于

2 个答案:

答案 0 :(得分:1)

尝试针对您的数据库运行DBCC CHECKDB,看起来您的系统表已损坏,ID为60,其中包含有关数据库中对象的信息。

jaromora; 去

答案 1 :(得分:0)

尝试使用

  

DBCC CHECKTABLE(YourTableName,REPAIR_REBUILD)

执行上述操作时,请确保您的数据库处于单用户模式。

如果这不起作用,则可以尝试删除表的主键并重新创建它。

如果问题仍然没有解决,那么;最后一个选择是:

  

DBCC CHECKTABLE(YourTableName,REPAIR_ALLOW_DATA_LOSS)