Forum Replies Created

Viewing 15 posts - 7,231 through 7,245 (of 7,597 total)

  • RE: Time as a high precision difference of dates

    TimeResult1 = -- ChrisR (5 date functions, 2 datatype conversions)

    TimeResult2 = -- ChrisM (5 date functions, 2 datatype conversions)

    ...

  • RE: Check that a specific Group By condition does not exist

    SELECT BlockID

    FROM #tblBlocks

    GROUP BY BlockID

    HAVING MAX(CASE WHEN BaseStage = 1 THEN 1 ELSE 0 END) = 0

    Include the TemplateID in the SELECT and GROUP BY if required.

  • RE: Time as a high precision difference of dates

    bmahf (9/6/2012)


    So it turns out that each of these solutions is missing something, it's either the fraction part sometimes comes out incorrect, because it wasn't adjusted as I was doing...

  • RE: Time as a high precision difference of dates

    Lynn Pettis (9/6/2012)


    Steven Willis (9/6/2012)


    ScottPletcher (9/6/2012)


    return an INT value, which at a precision level of 7 gets overflowed.

    The INT can't overflow returning billionths of a second -- the max possible...

  • RE: Time as a high precision difference of dates

    return an INT value, which at a precision level of 7 gets overflowed.

    The INT can't overflow returning billionths of a second -- the max possible value is 999,999,999, which is...

  • RE: Please Help on Trailing spaces

    Jeff Moden (9/6/2012)


    ScottPletcher (9/6/2012)


    I don't think audit triggers are relevant any more, given the better options built into SQL itself now.

    I've not found those options to do so well.

    Interesting. ...

  • RE: Please Help on Trailing spaces

    Jeff Moden (9/6/2012)


    I guess the trigger method for cleaning up new data would be ok but that places an insert tax on the system. I'd prefer not to do...

  • RE: Please Help on Trailing spaces

    It doesn't need a trigger because the data doesn't change, it just needs to be cleaned up.

    But the trigger DOES the clean up, which guarantees that (1) it occurs and...

  • RE: Please Help on Trailing spaces

    Sean Lange (9/5/2012)


    To me that is vastly better than using LTRIM/RTRIM on all subsequent queries!

    You certainly have a valid point. Not sure that adding an insert/update trigger on every table...

  • RE: create YTD in a Table

    To be fair, higher precision in intermediate calculations in complex equations can in fact cause errors rather than solving them.

    I'm certainly no authority on currency laws, so I can't speak...

  • RE: Please Help on Trailing spaces

    Sean Lange (9/5/2012)

    I don't think I agree that you should just add a trigger to trim spaces but we can agree to disagree here.

    To me that is vastly better than...

  • RE: Time as a high precision difference of dates

    I think you avoid all the CROSS APPLYs, as below.

    As written the code just ignores anything beyond 24 hrs, but if you needed to, you could add a check for...

  • RE: DBCC SHRINKFILE EMPTYFILE

    oradbguru (9/4/2012)Due to application limitations, there can only be the one existing filegroup.

    Thank you

    ?? Not sure I follow. Applications should be completely unaware of any filegroups in SQL...

  • RE: Please Help on Trailing spaces

    Edit: Removed, repeat.

  • RE: Please Help on Trailing spaces

    You should use a trigger to trim the data during INSERTs and UPDATEs -- NEVER let poorly formatted data be queried directly from the database.

    Personally I don't see anything wrong...

Viewing 15 posts - 7,231 through 7,245 (of 7,597 total)