Index Tuning Wizard.

  • Hi all, I am using the above wizard for the first time, and get an error.

    It does not seem to like the following query.

    Can anyone see a reason for this please.

    =================================START================

    SELECT

    SCORE = ((T2.SR_TITLE) + (T2.PRDINT_ID) + (T4.ROW_ID) + (T5.ROW_ID) + COUNT(DISTINCT T11.ATTRIB_01)),

    T2.SR_NUM,

    T2.ACT_OPEN_DT,

    T2.SRV_FEE_FLG,

    T2.SR_TITLE,

    T2.SR_STAT_ID,

    T2.SR_SUB_STAT_ID,

    T6.NAME,

    T7.NAME,

    T8.ADDR_NAME,

    T2.DESC_TEXT

    FROM dbo.S_SRV_REQ T1

    INNER JOIN dbo.S_SRV_REQ T2 ON T1.SR_TITLE = T2.SR_TITLE AND T1.PRDINT_ID = T2.PRDINT_ID AND T2.SR_STAT_ID<>'Duplicate' AND T2.ACT_OPEN_DT > getdate()-90

    INNER JOIN dbo.S_SRV_REQ_BU T3 ON T1.ROW_ID = T3.SRV_REQ_ID AND T1.BU_ID = T3.BU_ID LEFT OUTER JOIN dbo.S_SRV_REQ_XM T10 ON T1.ROW_ID = T10.PAR_ROW_ID AND T10.ATTRIB_08='Y'

    LEFT OUTER JOIN dbo.S_SRV_REQ_XM T11 ON T10.ATTRIB_01 = T11.ATTRIB_01 AND UPPER(T10.ATTRIB_02) = UPPER(T11.ATTRIB_02) AND T11.PAR_ROW_ID = T2.ROW_ID

    LEFT OUTER JOIN dbo.S_ADDR_PER T4 ON T1.OU_ADDR_ID = T2.OU_ADDR_ID AND T1.OU_ADDR_ID = T4.ROW_ID

    LEFT OUTER JOIN dbo.S_PROD_INT T5 ON T1.SP_PRDINT_ID = T2.SP_PRDINT_ID AND T1.SP_PRDINT_ID = T5.ROW_ID

    LEFT OUTER JOIN dbo.S_PROD_INT T6 ON T2.PRDINT_ID = T6.ROW_ID

    LEFT OUTER JOIN dbo.S_PROD_INT T7 ON T2.SP_PRDINT_ID = T7.ROW_ID

    LEFT OUTER JOIN dbo.S_ADDR_PER T8 ON T2.OU_ADDR_ID = T8.ROW_ID

    WHERE T1.ROW_ID='1-NQI7E' AND T2.ROW_ID<>'1-NQI7E'

    GROUP BY T2.SR_NUM,T2.ACT_OPEN_DT, T2.SRV_FEE_FLG, T2.SR_TITLE, T2.SR_STAT_ID, T2.SR_SUB_STAT_ID,T2.DESC_TEXT, T6.NAME, T7.NAME, T8.ADDR_NAME,T1.SR_TITLE, T2.PRDINT_ID, T1.PRDINT_ID, T4.ROW_ID, T1.OU_ADDR_ID, T5.ROW_ID, T1.SP_PRDINT_ID

    ORDER BY SCORE DESC

    ==================================END=================

    Cheers

  • Can you tell us what error u are getting when u run INdex tuning wizard? Does the quer run when u run from Query analyzer?

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply