Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: CTE DML

    You learn something new every day...The multiple rows on an Insert Into/Values fails on older versions of SQL, but has been added to SQL 2008+

  • RE: Hidden RBAR: Triangular Joins

    Actually I did make a version that replaced the call to up_CalculateEmailPoints_Insert, it was more a real life example of RBAR and how someone did what they could to avoid...

  • RE: Hidden RBAR: Triangular Joins

    Lynn,

    I think in many ways it is a blessing, but I do not like the timing. Seems like everyone out there sees this as a time to get senior experiance...

  • RE: Hidden RBAR: Triangular Joins

    Lynn Pettis (2/3/2009)


    LeeBear35 (2/3/2009)


    Not that I want to complain, but does anyone see a problem with a company that would retain a person that consistenly produces code like this:

    DECLARE @Count...

  • RE: Hidden RBAR: Triangular Joins

    Not that I want to complain, but does anyone see a problem with a company that would retain a person that consistenly produces code like this:

    DECLARE @Count INT

    SELECT @Count=MIN(EID) FROM...

  • RE: Solving the "Running Total" & "Ordinal Rank" Problems in SS 2k/2k5

    I have encountered problems with Merry Go Round issues too. On small samples it would always work but as data sets grew it was more and more of an issue...

  • RE: Hidden RBAR: Triangular Joins

    TheSQLGuru (1/22/2009)


    >>Any DBA who thinks an index on a bit field is a good idea.

    You have a billion row table, with from 0 to 100 rows at any one time...

  • RE: Hidden RBAR: Triangular Joins

    GSquared (1/22/2009)


    Joe Celko (1/22/2009)


    getdate()?? Didn't you mean to say CURRENT_TIMESTAMP? We want to use all the ANSI/ISO stuff that Microsoft will give us instead of UNIX dialect museum...

  • RE: Hidden RBAR: Triangular Joins

    It is a shame that anyone would cut such corners in project planning and development. Yes you may need to get the software out the door, but I watched as...

  • RE: Solving the "Running Total" & "Ordinal Rank" Problems in SS 2k/2k5

    As like the solution using the Anchor value, I have not seen that "fix" before. I also wondered if the clustered index was generated with a fillfactor=100 is the anchor...

  • RE: Hidden RBAR: Triangular Joins

    Although I would stay away from cursors on a couple million row table this would be the best I can come up with.

    Here is a 3x solution (one pass to...

  • RE: Hidden RBAR: Triangular Joins

    Your original query is:

    USE NorthWind

    SELECT

    [x].[OrderID],

    [x].[Freight],

    (

    SELECT

    SUM([y].[Freight])

    FROM [dbo].[Orders] [y]

    WHERE [y].[OrderID] <= [x].[OrderID]

    ) AS [RunningTotal],

    (

    SELECT

    COUNT([y].[Freight])

    FROM [dbo].[Orders] [y]

    WHERE [y].[OrderID] <= [x].[OrderID]

    ) AS [RunningCount]

    FROM [dbo].[Orders] [X]

    ORDER BY

    [x].[OrderID]

    This would...

Viewing 12 posts - 1 through 12 (of 12 total)