Implicit Conversions

  • If a table column has a datatype say VARCHAR(5)

    but the sproc references the column as

    Declare @column Varchar(10).

    Is that considered as an Implicit conversion, or is only when SQL has to change the data type in the background.

    Ie VArchar in the base table.

    To Nvarchar in the sproc.

  • There is no conversion for character size. From Varchar to NVarchar is a implicit conversion. See BOL "CAST and CONVERT (Transact-SQL) " for table

  • And remember, the conversions, implicit or explicit, are only issues if they occur in HAVING, WHERE, & ON criteria. Data conversion within the SELECT doesn't matter.

    "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

  • Thanks.;-);-);-);-)

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

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