Forum Replies Created

Viewing 15 posts - 5,521 through 5,535 (of 5,684 total)

  • RE: Help with PIVOT!

    WRACK (9/20/2010)


    I have modified it a little. TOTAL needed to be excluding today as it mentions in the column header of the example data in the first post so AVG...

  • RE: Help with PIVOT!

    This isn't pretty, but it works:

    SELECT MatrixName, [MON] AS 'MON', [TUE] AS 'TUE', [WED] AS 'WED', [THU] AS 'THU', [FRI] AS 'FRI', [TODAY] AS 'TODAY'

    , [mon]+[tue]+[wed]+[thu]+[fri]+[today] AS SumCnt, ([mon]+[tue]+[wed]+[thu]+[fri]+[today])/6 AS...

  • RE: Help with PIVOT!

    I felt nice... and yes, that's what I was looking for. 🙂

    CREATE TABLE #Rolling5Summary

    (MatrixOrderINT,

    MatrixNameVARCHAR(50),

    OriginalDateDATETIME,

    [DayOfWeek]VARCHAR(50),

    TotalCountINT

    )

    GO

    INSERT INTO #Rolling5Summary

    SELECT 1,'Mail In',CAST( '08/16/2010' AS DATETIME ), 'MON', 540 UNION ALL

    SELECT 1,'Mail In',CAST( '08/17/2010' AS...

  • RE: SQl Query performace

    Since you didn't post the execution plan, I'll ask the next question. 🙂

    Is there a difference in the execution plans between the two queries when you run them? Devil...

  • RE: Help with PIVOT!

    Any chance you can post the original query?

  • RE: Is this a 2005 bug?

    phil.layzell (9/19/2010)


    We have recently upgraded from 2000 to 2005 and the following issue has occurred with one of our SP's.

    This worked fine in 2000;

    "(@ReferenceNumber is NULL OR ( ISNUMERIC(P.ReferenceNumber) >...

  • RE: SQL Server DB Tools

    swethak13 (9/19/2010)


    Is there any standard approach in the ways to administer the SQL Server databases. As I am new and have no experience in these I don't know where to...

  • RE: Put logic inside Execute SQL Task or call sproc?

    My preference has, and almost always will be, SPROC if there's logic involved if I can get away with it. Primarily so that I only have to re-deploy a...

  • RE: (sql 2008) t-sql concurrency question.

    BarkingDog, the reason Jeff's solution is better then mine/ours is speed. His update method gets in and out in one action, whereas the select/update pair takes two. You...

  • RE: (sql 2008) t-sql concurrency question.

    Jeff Moden (9/19/2010)


    Heh... I'm just a step behind you on my posts...

    I've got the advantage, I'm west coast, so it's not beddie bye time for me yet, so I'm still...

  • RE: (sql 2008) t-sql concurrency question.

    Jeff Moden (9/19/2010)


    Ah... to be sure... the "Kalpa Shah" that I refer to in the revision history was one of the two Systems DBA's I was working with on this...

  • RE: (sql 2008) t-sql concurrency question.

    Barkingdog (9/19/2010)


    Jeff,

    My solution is the same as yours except I used:

    SELECT @return= NextID FROM seqNum with (UPDLOCK)

    Actually, that was me. Jeff's solution is much more elegant.

  • RE: (sql 2008) t-sql concurrency question.

    Ah, that makes sense, you're avoiding the necessity of the double call by using the running total method that's undocumented.

    Btw, if you force the tablockx, you won't get...

  • RE: (sql 2008) t-sql concurrency question.

    Jeff Moden (9/19/2010)


    Dang... I reviewed an article for someone on Sequence tables and now I can't find it.

    At any rate, the WORST thing you could possibly do is use a...

  • RE: Shouldn't the trans log backup be truncating my log file?

    You should be able to build a maintenance plan to do all that for you, and then automate it via SQL Agent.

Viewing 15 posts - 5,521 through 5,535 (of 5,684 total)