Luis Cazares - Tuesday, October 17, 2017 1:50 PM
Thanks for the reply Luis. Curiosity. It started as a work related problem - I replaced some charindex logic with patindex logic. Occasionally we'd get some instances of charindex('',''). After switching to patindex I got some 1's where I was expecting 0's. It was frustrating but, once I figured that patidex('','')=1 the problem was easy to fix.
Chris & SQL Pirate - Thanks to you both - I get it now. My real question (looking back I worded my question poorly) was, why does charindex('','') not equal patindex('','')?
Part of the my confusion was - if patindex('','')=1 then why does charindex('','') not equal 1? Nonetheless, you guys were both very helpful.
-- Itzik Ben-Gan 2001