Forum Replies Created

Viewing 15 posts - 1,696 through 1,710 (of 6,036 total)

  • RE: query for datetime

    Hugo Kornelis (1/12/2016)


    Yeah, and travelling ten miles if you happen to live near a timezone boundary can affect hour, day, month, and year parts, and in some areas of the...

  • RE: query for datetime

    Hugo Kornelis (1/12/2016)


    Sergiy (1/11/2016)


    No, I'm not confusing anything.

    DATETIMEOFFSET is indeed made up from the different values having totally different meaning.

    http://weblogs.sqlteam.com/peterl/archive/2010/12/15/the-internal-storage-of-a-datetimeoffset-value.aspx

    If you think that datetimeoffset violates relational theory, then you should...

  • RE: the use of CTEs

    Kedazs (1/12/2016)


    "If you do it more than once in a year - you need to rethink you approach to T-SQL programming, and probably take some lessons on how to do...

  • RE: Improving string comparisons that use like

    Alan.B (1/11/2016)


    As already stated. atomic values would be ideal but sometimes you have to play the schema your dealt. One solution would be Full Text indexing then, instead of WHERE...

  • RE: the use of CTEs

    Lynn Pettis (1/11/2016)


    Sergiy (1/11/2016)


    Kedazs (1/11/2016)


    Yes. I also use CTE's to "clean up my code". Especially if it is something being called multiple times within the select. I do...

  • RE: query for datetime

    Hugo Kornelis (1/11/2016)


    You are confusing content with representation. If the presence of a delimiter is key, then you could equally well argue that date is non-relational (delimiter being "-" or...

  • RE: Improving string comparisons that use like

    Eric M Russell (1/11/2016)


    In addition to dealing with 100s of external sources, the policy numbers coming from the same source, within the same source file, are coded inconsistently. There...

  • RE: the use of CTEs

    Kedazs (1/11/2016)


    Yes. I also use CTE's to "clean up my code". Especially if it is something being called multiple times within the select. I do not think there...

  • RE: query for datetime

    drew.allen (12/31/2015)


    GREAT! But suppose your company is going multi-national and they want to record dates using DATETIMEOFFSET. Update your code to use a DATETIMEOFFSET field with offsets ranging between...

  • RE: simplifying a complicated delete statement

    Magy (1/7/2016)


    Thanks. I tried joins, but I am not receiving the same number of rows as I am with the original query.

    I replace the delete with a select for...

  • RE: the use of CTEs

    Lynn Pettis (1/7/2016)


    I am not stupid

    Don't you sense a bit of Catch 22 here? 😉

    and I don't appreciate being called such explicitly or implicitly.

    You should not worry about such...

  • RE: the use of CTEs

    Lynn Pettis (1/7/2016)


    Then we should ban the use of views as well. How many times have we seen queries written with views nested in views, nested in views such...

  • RE: the use of CTEs

    Jeff Moden (1/7/2016)


    That being said, let's please avoid a "Banker's Rounding" discussion on this thread. Thanks guys.

    Too late, mate.

    Sorry. 😛

    But honestly, there is nothing wrong with using CTE's -...

  • RE: the use of CTEs

    Alan.B (1/7/2016)


    Using a CTE and keeping the code compatible with SQL 2005, we could re-write the code like this:

    WITH

    E1(N) AS

    (

    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT...

  • RE: Loop through an IN() clause?

    Magy (1/7/2016)


    productionStarted should be tr.productionStarted

    partID should be tr.partID

    Thanks!

    Hi Magy,

    The main question is about you "untested" CTE:

    SELECT ce.testerId, @partId as testId, 0 as resultCount,...

Viewing 15 posts - 1,696 through 1,710 (of 6,036 total)