Forum Replies Created

Viewing 15 posts - 4,036 through 4,050 (of 10,144 total)

  • RE: How do I convert column data into row data?

    Or CROSS APPLY VALUES:

    -- sample data

    ;WITH gennum (tollnum, n1, n2, n3) AS (

    SELECT 800123, 1234, 1235, 1236 UNION ALL

    SELECT 999123, 9876, 9875, 9874

    )

    -- solution

    SELECT g.tollnum, d.code

    FROM gennum g

    CROSS APPLY...

  • RE: Ugly SQL Statement takes to long to run. I need speed up help

    Your date arithmetic has two flaws which could cause your query to return incorrect results.

    1.They overlap. The day6 upper bound is C.SCHED_DTTM <= GETDATE()+6 and the day7 lower bound is...

  • RE: Tally Tables

    Hugo Kornelis (9/3/2013)


    ...- In the first plan, the NEWID() function is evaluated for each row. The results are then sorted, so that row numbers can be returned.

    - In the second...

  • RE: Tally Tables

    Toreador (9/4/2013)


    ChrisM@Work (9/4/2013)


    They don't yield the same result set using 2k8. The first query generates a different result set each time it's run.

    I get the same result set every...

  • RE: Tally Tables

    Rune Bivrin (9/3/2013)


    Just look at the execution plan and tell me if there is no difference.

    Or even try this, where NEWID() is completely eliminated from the second query.

    -- 1

    SELECT ROW_NUMBER()...

  • RE: How many columns in INCLUDED Index are 'Too Many' ???

    The first plan is less than optimal; Grant Fritchey writes about "Reason for Early Termination" here[/url].

    You've got a potentially redundant table in your FROM list - dbo.company_name -...

  • RE: Are the posted questions getting worse?

    GilaMonster (9/3/2013)


    Having fun preaching there Chris? :hehe:

    Oi don't you start! :hehe:

  • RE: Please help on these error messages

    What do you think this update statement should do?

    UPDATE @Results SET

    TQSDComment = SDAAFV.txtValue --AS TQSDComment

    FROM ActivitiesAdditionalFieldsValues AS SDAAFV

    LEFT JOIN ActivitiesAdditionalFields AS SDAAF

    ON...

  • RE: How many columns in INCLUDED Index are 'Too Many' ???

    T.Ashish (8/27/2013)


    Hi Chris,

    Thanks again for your help.

    I could not see any performance difference with/without function. I have pasted the function for you. Meanwhile I'm looking into third point you suggested.

    CREATE...

  • RE: Are the posted questions getting worse?

    L' Eomot Inversé (9/3/2013)


    Koen Verbeeck (9/3/2013)


    ChrisM@Work (9/3/2013)


    Jan Van der Eecken (9/3/2013)


    SQLRNNR (9/2/2013)


    Koen Verbeeck (9/1/2013)


    GilaMonster (8/31/2013)


    Just ....

    Microsoft will no longer offer Masters and Architect level training rotations and will be retiring...

  • RE: sql query

    Jeff Moden (9/2/2013)


    ramya.usapp (9/1/2013)


    Hello friends,

    Please help me in writing a query!!

    Question:

    Write a query based off of the following data stored in the AccountingEntry table. The query needs to return...

  • RE: Updating using # table

    Junglee_George (9/3/2013)


    Lend me a helping hand rather than preaching.....

    ChrisM@Work (9/3/2013)


    ...Start with your original query. Remove tables which don't contribute to your result set - including row count. Check if LEFT...

  • RE: Updating using # table

    This isn't a specific problem, it's ordinary day to day TSQL development work. Start with your original query. Remove tables which don't contribute to your result set - including row...

  • RE: Updating using # table

    Junglee_George (9/3/2013)


    Please help me to modify the query so that temp table can be used for updating the various columns like

    PhaseType, TQSDComment, TQPIComment, thus avoiding the left join using the...

  • RE: Are the posted questions getting worse?

    Jan Van der Eecken (9/3/2013)


    SQLRNNR (9/2/2013)


    Koen Verbeeck (9/1/2013)


    GilaMonster (8/31/2013)


    Just ....

    Microsoft will no longer offer Masters and Architect level training rotations and will be retiring the Masters level certification exams as...

Viewing 15 posts - 4,036 through 4,050 (of 10,144 total)