Forum Replies Created

Viewing 15 posts - 1,051 through 1,065 (of 2,462 total)

  • RE: the use of CTEs

    erics44 (1/8/2016)


    ChrisM@Work (1/8/2016)


    erics44 (1/8/2016)


    ChrisM@Work (1/8/2016)


    erics44 (1/8/2016)


    Hugo Kornelis (1/8/2016)


    erics44 (1/8/2016)


    Hugo Kornelis (1/8/2016)


    Jeff Moden (1/7/2016)


    Alan.B (1/6/2016)


    You can't write a recursive CTE with using pre-CTE features.

    Technically correct because only an rCTE can...

    "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: Salary vs contract rate?

    [font="Arial Narrow"]

    SeattleDBA (1/10/2016)


    Alan.B (1/4/2016)


    If the FTE salary for my area is $130,000 to $140,000 for a senior level DBA, that would be about $65 (W2) per hour based on 2,000...

    "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: Adios, IE

    Good riddance, I'm a Chrome guy myself. The only time I have IE open is because some application/website that I am working with must work with IE (e.g. an SSRS...

    "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: When a Service Pack or Cumulative Update Install Fails by “Evaporating"

    Good stuff. I've been there.

    "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: Longest Common Substring in an ITVF

    First, sorry for falling off the radar - I personally get annoyed when people post a question then vanish. That said I have been looking at and playing around 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: the use of CTEs

    jaime.simancas 27970 (1/7/2016)


    Alan.B (1/7/2016)


    erics44 (1/7/2016)


    Lynn Pettis (1/7/2016)


    You have to remember that many times threads go off on tangents, and sometimes the tangents actually impart knowledge that may not 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: the use of CTEs

    Lynn Pettis (1/7/2016)


    Sergiy (1/7/2016)


    Alan.B (1/7/2016)


    Using a CTE and keeping the code compatible with SQL 2005, we could re-write the code like this:

    ...

    Huge, Huge improvement!!! Irrefutable evidence of the usefulness of...

    "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: the use of CTEs

    erics44 (1/7/2016)


    Lynn Pettis (1/7/2016)


    You have to remember that many times threads go off on tangents, and sometimes the tangents actually impart knowledge that may not have been provided otherwise.

    I don't...

    "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: the use of CTEs

    .... and DelimitedSplit8K_LEAD

    DECLARE

    @pString varchar(8000) = 'xxx,yyy,zzz',

    @delimiter char(1) = ',';

    SELECT

    ItemNumber = ROW_NUMBER() OVER (ORDER BY (SELECT NULL)),

    ...

    "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: the use of CTEs

    Eh, I decided to join in the fun and got beat to it (I realized what I posted earlier had CTEs in it)

    Using delimitedsplit8K logic... here's one that's not limited...

    "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: the use of CTEs

    Sergiy (1/6/2016)


    Complete version, including non-CTE on-fly Tally table:

    DECLARE @pString VARCHAR(8000), @pDelimiter CHAR(1)

    SET @pString = 'aaaa,,ccc,d,'

    SET @pDelimiter = ','

    SELECT ItemNumber = ROW_NUMBER() OVER(ORDER BY cteLen.N1),

    ...

    "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: the use of CTEs

    Sergiy (1/6/2016)


    Lynn Pettis (1/6/2016)


    Unfortunately you failed to recreate the function as originally coded. You are relying on the existence of a tally table in the database. The original...

    "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: the use of CTEs

    <Removed> got hit by the Reply bug

    "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: the use of CTEs

    Luis Cazares (1/6/2016)


    Been following this discussion, but I didn't feel like getting in it.

    I believe that over use of CTEs is as bad as the lack of CTEs. I'd rather...

    "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: the use of CTEs

    erics44 (1/6/2016)


    Alan.B (1/6/2016)


    erics44 (1/6/2016)


    Alan.B (1/6/2016)

    This is just silly. Every MVP and Certified Master whose article and/or book I have read uses CTEs. And I use them and I know how...

    "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,051 through 1,065 (of 2,462 total)