Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401

    Unanswered: PatIndex vs Like

    My tests show both of them perform exactly the same... any conditions where either one may have an advantage ???
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    If you are looking for PATINDEX = 1 and the predicate is on an indexed column.

    Like can seek. Patindex will scan.

    Google "sargable"
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Aug 2004
    Location
    Dallas, Texas
    Posts
    831
    You can also use PATINDEX in a substring function but LIKE doesn't work so well.

Posting Permissions

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