Home Forums SQL Server 2017 SQL Server 2017 - Development split text into rows: The maximum recursion 100 has been exhausted before statement completion RE: split text into rows: The maximum recursion 100 has been exhausted before statement completion

  • Eirikur Eiriksson - Wednesday, January 16, 2019 9:23 AM

    ChrisM@Work - Wednesday, January 16, 2019 9:03 AM

    Eirikur Eiriksson - Wednesday, January 16, 2019 8:49 AM

    Jonathan AC Roberts - Wednesday, January 16, 2019 8:37 AM

    Eirikur Eiriksson - Wednesday, January 16, 2019 8:30 AM

    ChrisM@Work - Wednesday, January 16, 2019 8:16 AM

    Jeff Moden - Wednesday, January 16, 2019 8:10 AM

    Jonathan AC Roberts - Wednesday, January 16, 2019 6:40 AM

    marc.corbeel - Wednesday, January 16, 2019 6:14 AM

    yes I know, but some clients still use version 2012... so I cannot use it

    If you want the quickest fix just add OPTION (MAXRECURSION 1000) to your select query.
    If performance is an issue then Eirikur's code will be much faster and works with SQL 2012.

    I guess I'd never recommend trying to fix the recursive method.

    It's a little like choosing to use this for a few hazel nuts.

    Mate, you owe me a keyboard πŸ˜€
    😎 

    Luckily, my laptop is "beerproof"

    That seemed it was meant to be a sledgehammer to crack a nut joke. But I don't see how it relates to this? What's the sledgehammer? Surely not a weakly performing rCTE?

    The sledgehammer is the rCTE, and you are being very gentile using the word "weakly" here, which translates to "poorly" even if done "weekly"πŸ˜‰
    😎
    It still drive me bonkers, how many are using sub-optimal code for such a common thing as splitting DSV/CSVs.
    Chris's post just mate me laugh when having a mouthful of a beautiful aleπŸ˜€

    Stop it, you're making me thirsty!

    Abbot ale, absolutely beautiful:laugh:
    😎
    When are we meeting up next? I'll be happy to quench your thirst.

    Sooon!!

    I'm snowed under πŸ™ I'll be in touch when I can punch an arm through it.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden