Forum Replies Created

Viewing 15 posts - 1,516 through 1,530 (of 3,957 total)

  • RE: concatenate with leading zeros

    Jeff Moden (9/9/2013)


    The results are, indeed, pretty close especially considering the number of rows. However, just imagine if you could make all of your code run twice as fast....

  • RE: concatenate with leading zeros

    Mine seems to have gotten lost in the shuffle there in your last test harness, but I can see what you've done. Results look pretty close.

    For some reason, I'm...

  • RE: concatenate with leading zeros

    Jeff Moden (9/9/2013)


    dwain.c (9/9/2013)


    At the risk of being called a contrarian, this can be done without using RIGHT:

    WITH SampleData (C1, C2) AS (

    SELECT 1234, 1

    UNION ALL SELECT 12345, 11

    UNION ALL...

  • RE: round down

    In SQL 2008 R2:

    SELECT ROUND(123.5555, 0, 1) -- Truncate to integer

    ,ROUND(123.5555, 1, 1) -- Truncate to first decimal digit

    ...

  • RE: concatenate with leading zeros

    At the risk of being called a contrarian, this can be done without using RIGHT:

    WITH SampleData (C1, C2) AS (

    SELECT 1234, 1

    UNION ALL SELECT 12345, 11

    UNION ALL SELECT 123456, 111)

    SELECT...

  • RE: A Hazard of Using the SQL Update Statement

    James_DBA (9/9/2013)


    The first thing I thought of when looking at the code example is how the join was only part of the natural key used in table #test2. SET based...

  • RE: A Hazard of Using the SQL Update Statement

    Roger L Reid (9/9/2013)


    No reason for controversy except the inflammatory title (and if publicity is your goal, then even that's well done).

    Your point is that the generalist programmer often doesn't...

  • RE: A Hazard of Using the SQL Update Statement

    Excellent feedback Paul! Absolutely nothing in it I could argue with.

    Didn't know about the SQL Connect article (quite interesting) but I did know the syntax wasn't ANSI standard, even...

  • RE: Add a flag field if all rows match?

    Here's one way that lists all Sales Order records.

    WITH CTE AS (

    SELECT SalesOrderID

    FROM #SalesOrders a

    LEFT JOIN #ProductList b...

  • RE: A Hazard of Using the SQL Update Statement

    Jeff Moden (9/8/2013)


    This is a great article in that it makes people, especially newbies who may have not studied the nuances of the T-SQL UPDATE statement to its fullest depth,...

  • RE: Add a flag field if all rows match?

    If you just want the SalesOrderID that match your criteria:

    SELECT SalesOrderID

    FROM SalesOrders a

    LEFT JOIN ProductList b ON a.ProductID = b.ProductID

    GROUP BY SalesOrderID

    HAVING COUNT(CASE WHEN b.ProductID IS NULL THEN 1 END)...

  • RE: Elapsed time

    I've made a submission.

    I hope it's what you were looking for and more importantly I hope I didn't miss some kind of trick part of the question.

  • RE: Elapsed time

    I'll give it a look this weekend.

  • RE: Elapsed time

    Will each runner have at most 2 entries?

    If only one entry (start time), then what would you like to see for elapsed time?

    If more than 2, does the...

  • RE: Are the posted questions getting worse?

    Sean Lange (9/4/2013)


    Well this post is my 10,000th point. I guess I have proved I too can waste lots of time answering forums posts instead of doing my actual job....

Viewing 15 posts - 1,516 through 1,530 (of 3,957 total)