Forum Replies Created

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

  • RE: cumulative average without cursor

    OK, here is another solution that I believe is stripped down to the basics:

    INSERT INTO [#gpa]

    VALUES (1,'math',3),

    (1,'eng',4),

    ...

  • RE: cumulative average without cursor

    Try the following, the concept is:

    1. do a cross join of all courses and terms

    2. left join the results of the cross join to the marks...

  • RE: The Scientific Method: a call to action

    I am surprised that nobody has mentioned the obvious next requirement which is an accessible and searchable repository where people can research and find previously performed proofs to allow people...

  • RE: How to handle this

    I believe this will handle your first case:

    SELECT [col1ID]

    , CAST(CASE WHEN MIN([Col2ID]) = MAX([Col2ID]) THEN 1 ELSE 0 END AS BIT) AS [Bit]

    FROM...

  • RE: Find the Numbers from a string

    For the set-based, tally table, CTE freaks among us, here is a set-based solution that uses a tally table and CTEs:

    SET NOCOUNT ON;

    -- The @Strings table variable represents whatever...

  • RE: Creating a Date Range from Multiple Rows Based on a Single Date

    Dwain,

    I liked your analysis of the different options for building a resultset that included both an in-effect and an out-of-effect date, BUT I think you missed the boat on the...

  • RE: inconsistently wrong query results

    Things to keep in mind:

    - the BETWEEN operator is the logical equivalent of ">= and <=".

    - the DATETIME datatype has...

  • RE: concatenate with leading zeros

    Apologies for not being clear... I've been in a real crunch for the last week or so.

    What I meant was just exactly what you said. You write the data...

  • RE: concatenate with leading zeros

    Part of the reason why Paul S. might be seeing some instability is because he didn't trust the @Bitbucket variable and took to writing to disk. Depending...

  • RE: concatenate with leading zeros

    dwain.c (9/10/2013)


    Paul - I get fairly stable results with this test harness. Can you confirm?

    I am also running on a SQL Server that is fairly quiescent (no other processes...

  • RE: concatenate with leading zeros

    OK, this one really sucked me in for more than I planned on doing!

    I was surprised by the variability in the results and thought that there had to be something...

  • RE: concatenate with leading zeros

    Interestingly, by using a variable instead of 1000000 it was faster, but using a variable instead of 1000 makes it slower!

    Here is the script I used for testing followed by...

  • RE: concatenate with leading zeros

    Here is another variation on the math method that my testing says is a little faster:

    DECLARE @Billion INT;

    SET @Billion = 1000000000;

    SET STATISTICS TIME ON;

    SELECT @Bitbucket...

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