Results 1 to 4 of 4

Thread: Implicit conversions

  1. #1
    Join Date
    Nov 2010
    Posts
    2

    Implicit conversions

    Hi,

    I have a Integer column in a table which is basically the datekey,e.g 20101101.
    If I want to get only the year and month from this column is it better to use left(datekey,6) OR datekey/100.
    The Left would use implicit conversion.
    Which would be faster ?

    Thanks !

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Same cost but datekey/100 uses less cpu time per my test.
    Last edited by rmiao; 11-30-2010 at 12:51 PM.

  3. #3
    Join Date
    Nov 2010
    Posts
    2
    My test came up with the same plan in both the cases as well.
    So in general, would implicit conversions always be slower ?

    Thanks !

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Maybe number of rows affected have play here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •