Forum Replies Created

Viewing 15 posts - 1,846 through 1,860 (of 2,458 total)

  • RE: do you have a StripNonNumeric ITVF function?

    Jeff Moden (10/30/2014)


    We also need to try the same thing on Alan's good pattern matching code.

    Sorry for not checking back sooner - I spent the weekend dealing with some <sarcasm>very...

    "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

  • RE: do you have a StripNonNumeric ITVF function?

    So I made the following change to Eirikur's function to so that it takes a pattern as a parameter:

    -- refactoring...

    CREATE FUNCTION dbo.STRIP_NUM_EE_PAT

    (

    @INSTR VARCHAR(8000),

    ...

    "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

  • RE: do you have a StripNonNumeric ITVF function?

    Jeff Moden (10/28/2014)


    I took the two contenders from your good post, Alan, and added on of my own. Here's the code for the function I use for such things....

    "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

  • RE: do you have a StripNonNumeric ITVF function?

    Eirikur Eiriksson (10/28/2014)


    Little clean up in the logic, now it looks pretty good

    😎

    /********************************************************************

    -- Stripping out any non-numerical characters

    -- EE 2014-10-28 Inital coding

    -- EE ...

    "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

  • RE: do you have a StripNonNumeric ITVF function?

    Jeff Moden (10/27/2014)


    Out of all of these submittals, which post has the fastest code? I'd check for myself but I'm on the run right now but want to check...

    "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

  • RE: do you have a StripNonNumeric ITVF function?

    mickyT (6/25/2014)


    Hi

    Interestingly enough I tried a similar test on 2012 for the originals and got elapsed times that so close as to be the same. It may have been...

    "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

  • RE: Sum subset in group

    Alan.B (10/10/2014)


    SELECT column1, sum (column2)

    FROM <yourtable>

    WHERE column1=1

    GROUP BY column1

    How embarrassing, I did not realize, at the time I posted this, that this was an SSRS forum (smacking forehead).

    "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

  • RE: Sum subset in group

    SELECT column1, sum (column2)

    FROM <yourtable>

    WHERE column1=1

    GROUP BY column1

    "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

  • RE: Improving Index Seek

    Jason beat me toops it...Estimated rows are 1, actual are 860... sounds like a possible stats issue.

    Could also be parameter sniffing. Have you tried running your query with...

    "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

  • RE: Import data from html document Into SQL Table

    Eirikur Eiriksson (10/9/2014)


    Nice job Alan!

    😎

    Thanks!

    "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

  • RE: Import data from html document Into SQL Table

    1. Phil's article is excellent; I never read it until today after I saw that Erikur posted it.

    2. Second, can you post and example of the HTML files that...

    "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

  • RE: Removing Non-Alphabetical Characters

    I think you were pretty close... You could do this:

    WITH removebadstuff(old,new) AS

    (

    SELECT LastName, replace(replace(replace(replace(replace(lastname,'#',''),'^',''),'/',''),'\',''),' -','')

    FROM #tmp_lastnames

    )

    SELECTold, -- old here for display only, not needed

    new =

    case patindex('%[a-z][^a-z]',new)

    when 0 then new...

    "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

  • RE: CHECKDB fails, then succeeds after restore to another instance

    Plucky (10/7/2014)


    Hi

    Occasionally (once every 3 months or so) CHECKDB fails on our busiest database on our VMware management SQL Server instance (this is a VM itself 10.0.5775). No other VMs...

    "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

  • RE: Tally OH! An Improved SQL 8K “CSV Splitter” Function

    samirabrahao1 60347 (10/7/2014)


    Hello Jeff, Paul, and everyone else involved in this discussion.

    I hope you are still following up on this. Great article indeed.

    I took the liberty to make a minor...

    "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

  • RE: Performance of the new (2014) Cardinality Estimator

    GilaMonster (10/7/2014)


    Alan.B (10/6/2014)


    So it is whatever the default is - is what it is set at. I will tell you exactly tomorrow.

    Which means it'll be cost threshold of 5 and...

    "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

Viewing 15 posts - 1,846 through 1,860 (of 2,458 total)