Performance point of view

  • Taking into performance point of view, is it better to use CAST instead of CONVERT

    Take this for example,

    SET @StartDate = CONVERT(DATE, @FromDate)

    SET @EndDate = CONVERT(DATE, @ToDate)

    Will it make any difference if I use CONVERT here

  • The choice isn't about performance. CONVERT allows you to specify the format code for the date, CAST doesn't.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • And if you'd like to see some test results: Cast vs Convert

    A bit old,but i think still valid.

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

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