Type conversion in expression - Warning

  • Hi All,

    Getting Type Conversion Error for Select statement.

    LEFT OUTER JOIN PART_LIST p2 ON e.status = p2.PART

    AND p2.PART_TYPE = 'ABC'

    Type conversion in expression (CONVERT_IMPLICIT(nvarchar(10),[e].[STATUS],0)) may affect "CardinalityEstimate" in query plan choice

    e.status = varchar(10)

    p2.part = nvarchar(100)

    Please, assist. Tried CAST and CONVERT, still it didnt work.

    * Can't change the type of the table.

  • Then you're stuck. You're trying to compare two different data types. SQL Server has to convert them in order to compare them. No choice there. To get index use assured, you'll have to change one of the data types.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • What about if you can put a subset-rows from PART_LIST into a temp table and make a LEFT OUTER JOIN with it. You can put a necessary index on the temp table too. Consider the tempdb collation.

    Regards,

    Igor

    Igor Micev,My blog: www.igormicev.com

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

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