• Matthias Kläy (11/28/2014)


    Hi Alan

    Thanks for this great function. One note:

    SELECT * FROM dbo.PatExclude8K('123# What?!... ', '[^a-z!?.]')

    returns hat?!...

    So it is case sensitive, contrary to your comment in the programmers notes. I guess this comes from the Latin1_General_BIN collation.

    To get the result as expected, I can use

    SELECT * FROM dbo.PatExclude8K('123# What?!... ', '[^a-zA-Z!?.]')

    Matthias Kläy, http://www.kcc.ch

    Thanks Matthias for your feedback and good catch! I did realize that the Latin1_General_BIN would make the function case sensitive but never updated my developer comments to reflect that change. This was my first script and I don't know what the SQLServerCentral protocol is for changing a script once it is published. I will update the developer comments once I figure out how 😎

    P.S. Sorry for the late reply, it's been a busy couple weeks of moving and project wrap-up.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001