>I have a SQL SELECT that I can't get to
>optimize properly. I have a source table
>from which I'm creating an output file in
>the same format with some additional fields.
>
>I am linking an error table that details the
>exceptions in processing the main file.
>
>There are no indexes on the input file, as the
>input files are always processed sequentially.
>I have several indexes on the error table
>including Code, Fed_TaxId, and Tax_Sufx.
>
>Below is my SQL statement:
>
>
>
> ?SYS(3054,2)
> SELECT DataPPO.* ;
> , ReimbrsKey AS OldReimbrs ;
> , OtherId AS OldOtherId ;
> , DtToCompJul( MaintDate) AS MaintComp ;
> , DtToJul( MaintDate) AS MaintJul ;
> , dmlError.dm_Link ;
> , "K" AS StatusCode ;
> , DataPPO.Tax_Sufx AS Old_Sufx ;
> , .F. AS REPLACED ;
> , dmlError.CODE ;
> FROM DataPPO ;
> LEFT JOIN dmlError ;
> ON DataPPO.Fed_TaxId = dmlError.Fed_TaxId ;
> AND DataPPO.Tax_Sufx = dmlError.Tax_Sufx ;
> AND dmlError.Code = "120" ;
> INTO TABLE dmoPPO
>
>
>
>With the statement as is I get only partial
>optimization. If I take out the "120" code
>filter I get no optimization at all.
>
>What the heck am I doing wrong???
>
>advTHANKSance
>
> ...kt
Try looking that the Rushmore KB article on my web site.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer