none
DBCC DBREINDEX

    Question

  •  

    DBCC CHECKDB;
    GO
    Result:
    DBCC results for 'AgentsStateChanges'.
    There are 2422697 rows in 46484 pages for object 'AgentsStateChanges'.
    CHECKDB found 0 allocation errors and 92 consistency errors in table 'AgentsStateChanges' (object ID 2025058250).

     

    Server: Msg 8934, Level 16, State 3, Line 1
    Table error: Object ID 53575229, index ID 1. The high key value on page (1:193625) (level 0) is not less than the low key value in the parent (0:1), slot 0 of the next page (1:269532).
    Server: Msg 8935, Level 16, State 1, Line 1
    Table error: Object ID 53575229, index ID 1. The previous link (1:269531) on page (1:269532) does not match the previous page (1:193625) that the parent (1:272396), slot 252 expects for this page.
    Server: Msg 8936, Level 16, State 1, Line 1
    Table error: Object ID 53575229, index ID 1. B-tree chain linkage mismatch. (1:193625)->next = (1:269532), but (1:269532)->Prev = (1:269531).
    Server: Msg 2511, Level 16, State 1, Line 1
    Table error: Object ID 53575229, Index ID 2. Keys out of order on page (1:266856), slots 14 and 15.
    Server: Msg 2511, Level 16, State 1, Line 1
    Table error: Object ID 53575229, Index ID 2. Keys out of order on page (1:266856), slots 154 and 155.
    Server: Msg 2511, Level 16, State 1, Line 1
    Table error: Object ID 53575229, Index ID 2. Keys out of order on page (1:266869), slots 49 and 50.

     

    DBCC DBREINDEX ('Vestel.dbo.AgentsStateChanges', PK_LLAgentFlowSummary, 0);
    GO

    Result:
    Server: Msg 1505, Level 16, State 1, Line 1
    CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 1. Most significant primary key is 'type 24, len 16'.
    The statement has been terminated.

     

     

    PLEASE HELP!;

    GO

     

     

    Friday, September 21, 2007 1:22 PM

All replies

  • Hi,

     

    Have you used DBCC CHECKDB to try repairing the consistency errors being using DBCC DBREINDEX?

     

    Regards,

     

    Gary.

     

    Friday, September 21, 2007 2:09 PM
  •  Gary Wells wrote:

    Hi,

     

    Have you used DBCC CHECKDB to try repairing the consistency errors being using DBCC DBREINDEX?

     

    Regards,

     

    Gary.

     

     

    Hi Gary,

     

    Yes, of course.

     

     

    Thanks & Regards,

     

    Melih

    Friday, September 21, 2007 8:26 PM
  • I ran the query below to find the duplicate values and I got the error message.

     

    select Msg_ID, count(Msg_ID)
    from AgentsStateChanges
    group by Msg_ID
    having count(Msg_ID)>1

     

    Server: Msg 409, Level 16, State 2, Line 1
    The count aggregate operation cannot take a uniqueidentifier data type as an argument.
    Server: Msg 409, Level 16, State 1, Line 1
    The count aggregate operation cannot take a uniqueidentifier data type as an argument.

    Friday, September 21, 2007 8:55 PM

  • Looks like you are using Sql Server 2000. You can't do count or group by on uniqueidentifier columns in version 2000. This can be done in 2005 though.
    Saturday, September 22, 2007 1:40 AM
    Moderator
  •  Sankar Reddy wrote:

    Looks like you are using Sql Server 2000. You can't do count or group by on uniqueidentifier columns in version 2000. This can be done in 2005 though.

     

    Yes, Sankar Reddy

     

     

    We are using Sql2k. So, how can I solve this issue?

     

    Thanks&Regards,

    Melih

    Saturday, September 22, 2007 9:13 AM
  •  OK. No dublicate values:
     
      select Msg_ID, count(*) 
      from AgentsStateChanges 
      group by Msg_ID
      having count(*)>1
     
    result:
     (0 row(s) affected)

    But, I'm trying this and I'm finding 79 pieces dublicate values

     

    select cast(Msg_ID as varchar(36)), count(*)
    from AgentsStateChanges
    group by cast(Msg_ID as varchar(36))
    having count(*)>1

     

    result:

     (79 row(s) affected)

     

    I'm trying some values from duplicate values and I get 0 row message interestingly

    select * FROM AgentsStateChanges where Msg_ID=
    '100CEB2E-6B69-0058-0001-000000000001'

    result:
     (0 row(s) affected)

    I dont understood anything.

     

    Melih

    Monday, September 24, 2007 7:58 AM