SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Is It Time To Clear Out Those Quirky Functions?


Is It Time To Clear Out Those Quirky Functions?

Author
Message
Phil Factor
Phil Factor
SSCarpal Tunnel
SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)

Group: General Forum Members
Points: 4774 Visits: 3031
Comments posted to this topic are about the item Is It Time To Clear Out Those Quirky Functions?


Best wishes,

Phil Factor
Simple Talk
mickyT
mickyT
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2782 Visits: 3318
I couldn't agree more, it would be nice to clean up some of these things.

Personally I would leave REPLACE alone and add a PATREPLACE.
I would also like to see CHARINDEX/PATINDEX changed to have an occurrence parameter, eg find the 2nd occurence of char in string starting from character 10.

On ISNUMERIC, Grant Saunders recently posted a nice little workaround for it.
Carlo Romagnano
Carlo Romagnano
SSCertifiable
SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)

Group: General Forum Members
Points: 7449 Visits: 3395
I'd like also a SPLIT/JOIN function as in VB. So, given a tab/cr limited string the function returns a table and viceversa.
PURGECHAR removes a list of chars from a string.

I run on tuttopodismo
call.copse
call.copse
SSCertifiable
SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)SSCertifiable (5.6K reputation)

Group: General Forum Members
Points: 5564 Visits: 2008
Carlo Romagnano (7/10/2014)
I'd like also a SPLIT/JOIN function as in VB. So, given a tab/cr limited string the function returns a table and viceversa.
PURGECHAR removes a list of chars from a string.


There's plenty of ways to do the split (or indeed) thing for example a nice CTE way:
http://ole.michelsen.dk/blog/split-string-to-table-using-transact-sql/

Looking at your experience I'm guessing you did know that ;-) but think a built in way would be preferable. The only thing I might say is that the nuances of what you might want to do often vary for such tasks so maybe rolling your own is preferable? To me there may be better candidates for a renewal, I like the cut of Phil's jib on this one.

I really hate the search-y functions in SQL though - I know they are powerful and indeed flexible, but somehow still absolute pony IMHO.
j.zinn
j.zinn
SSC-Addicted
SSC-Addicted (466 reputation)SSC-Addicted (466 reputation)SSC-Addicted (466 reputation)SSC-Addicted (466 reputation)SSC-Addicted (466 reputation)SSC-Addicted (466 reputation)SSC-Addicted (466 reputation)SSC-Addicted (466 reputation)

Group: General Forum Members
Points: 466 Visits: 61
I'd love to see a native Regular Expression support. I sometimes use a CLR for pattern matching, but it's a slow alternative to a natively incorporated function. Using Regular Expressions in pattern matching (and for building new strings from old) would be very powerful.
tripleAxe
tripleAxe
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2066 Visits: 13544
Top of my list is GROUP_CONCAT, closely followed by REPLACE with wildcards.
Holy One
Holy One
SSC Journeyman
SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)

Group: General Forum Members
Points: 80 Visits: 410
Agree with Phil on ISNUMERIC especially -- unbelievable the language doesn't have a working function for this!
Chord77
Chord77
SSC-Enthusiastic
SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)

Group: General Forum Members
Points: 131 Visits: 356
j.zinn (7/10/2014)
I'd love to see a native Regular Expression support. I sometimes use a CLR for pattern matching, but it's a slow alternative to a natively incorporated function. Using Regular Expressions in pattern matching (and for building new strings from old) would be very powerful.


I agree this would be nice.
Alan.B
Alan.B
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13110 Visits: 8000
ISNUMERIC('-') returns a 1. Discovered that this week (at an inconvenient time no less).

-- Alan Burstein



Best practices for getting help on SQLServerCentral
Need to split a string? Try DelimitedSplit8K or DelimitedSplit8K_LEAD (SQL 2012+)
Need a pattern-based splitter? Try PatternSplitCM
Need to remove or replace those unwanted characters? Try PatExclude8K and PatReplace8K.

"I can't 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. " -- Itzek Ben-Gan 2001
below86
below86
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1744 Visits: 2715
I would like to see the TRIM available. And why not change ISNULL to work the same way COALESCE does. ISNULL just seems to be more descriptive of what it does, IMHO.
COALESCE by my Webster dictionary means "To grow or come together into one". You are not growing or merging data, you are returning the first not NULL.

-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search