select * from SaleMaster
甚至无法查看表...... 据我所知,我知道错误发生在哪里。 我在此表中有一个聚簇和非聚簇索引 指数法
ALTER TABLE [dbo].[SaleMaster] ADD CONSTRAINT [PK_SaleMaster] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [salesmanRefIdIX] ON [dbo].[SaleMaster]
(
[salesmanRefId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [WholesaleBillingMasterRefIdIX] ON [dbo].[SaleMaster]
(
[WholesaleBillingMasterRefId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [WholesaleBillingMasterNewRefIdIX] ON [dbo].[SaleMaster]
(
[WholesaleBillingMasterNewRefId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
每天晚上我有重建这些索引的工作 但由于电源问题导致系统关闭,索引损坏
我已经尝试过拆解,重建,重新组织,放弃任何无效的工作。
我也试过了这个嫌疑人的查询
第1步在SQL查询中执行两行
EXEC sp_resetstatus 'yourDBname';
ALTER DATABASE yourDBname SET EMERGENCY
第2步刷新数据库。然后执行下一行
DBCC checkdb('yourDBname')
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
第3步刷新数据库。然后执行下一行
DBCC CheckDB ('yourDBname', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER
但到目前为止没有任何工作..... 最后我尝试使用一些第三方软件,如Stellar Phoenix SQL Database Repair(它显示数据),那么有什么方法可以获得这些数据? 我只是想要数据不需要主键r只需要我需要的数据