Forum Replies Created

Viewing 15 posts - 196 through 210 (of 557 total)

  • RE: How to write a string to a file in SQL.

    Thom A - Tuesday, January 10, 2017 9:39 AM

    If you are using the SSIS Catalog to deploy your projects, then running them from...

  • RE: Overlapping datetime ranges.

    Sergiy - Tuesday, January 10, 2017 8:11 PM

    ben.brugman (1/6/2017)


    Jason A. Long (1/5/2017)If I'm understanding correctly, the objection is that the "obliterated" rows are...

  • RE: How to write a string to a file in SQL.

    Eirikur Eiriksson (1/10/2017)

    You will have to elaborate further on the requirements, UTF-8 is unicode hence multi byte!

    😎

    Oops, my bad, I want an 8 bit character set and not a 2...

  • RE: Overlapping datetime ranges.

    Jason A. Long (1/5/2017)

    If I'm understanding correctly, the objection is that the "obliterated" rows are displaying the "MaxPrevEnd" values in the NewBeg & NewEnd columns, rather than the original EndDate.

    Sorry,...

  • RE: Overlapping datetime ranges.

    --============================================================================

    -- The actual solution... (Based on the solution given by Jason A. Long, thanx).

    -- Adapted to the example.

    -- Corrected for : 1 Enddate does not change.

    --...

  • RE: Overlapping datetime ranges.

    Jason A. Long (12/22/2016)


    This should be a simpler & faster solution as it only takes a single pass over the data...

    -- Setup some test data...

    IF OBJECT_ID('tempdb..#TestData', 'U') IS NOT NULL...

  • RE: Overlapping datetime ranges.

    Jason A. Long (12/22/2016)


    Here's what the solution looks like laid out graphically in Excel (note: I change a few dates to compact the ranges...)

    Exactly what was asked, thank you.

    I am...

  • RE: Overlapping datetime ranges.

    Sergiy (12/22/2016)


    Can you post your TestTable definition?

    The testtable definition was in the post before my previous post.

    At the start of that code the text is : -- ...

  • RE: Overlapping datetime ranges.

    Sergiy (12/20/2016)


    Here is something to start with:

    SELECT ID, FromValue, ToValue

    INTO #Periods

    FROM (

    SELECT 1, 2.1, 8.0

    UNION

    SELECT 2, 3., 4.5

    UNION

    SELECT 3, 4., 10.

    UNION

    SELECT 4, 9., 20.

    ) I (ID, FromValue,...

  • RE: Overlapping datetime ranges.

    All thanks for your time and attention.

    I started of with the post:

    http://www.sqlservercentral.com/Forums/Topic1760478-3412-1.aspx

    And tried to construct a solution from the solution presented there.

    That was a bad idea. Spend some time on...

  • RE: Overlapping datetime ranges.

    drew.allen (12/20/2016)


    Most approaches that I've seen collapse the ranges. That is, they don't retain a record with a zero length. Is there a particular reason that you need...

  • RE: To much (early) blocking.

    BrainDonor (12/1/2016)


    I wrote a small series on isolation levels a while back, so I could understand how they worked.

    Start at http://wp.me/p3Vxvi-8R and see if they help.

    Yes this does help. Thanks.

    Although...

  • RE: To much (early) blocking.

    GilaMonster (12/1/2016)


    Keep in mind that the isolation levels affect the behaviour of *read* queries, not data modifications for the most part.

    Repeatable read vs read committed: can two identical selects within...

  • RE: Performance improvement on statement.

    ChrisM@Work (10/21/2016)


    The guesses made by the optimiser are whacked somewhat by the ranges.

    Yes they are WHacked.

    Try forcing a loop join reading first from the ranges table like this:

    SELECT *

    FROM...

  • RE: How to get percent of total

    Here is a 'fairly' simple solution to your problem.

    First a table is 'created' which contains the totals for each column.

    Then this table is used to calculate the percentages for all...

Viewing 15 posts - 196 through 210 (of 557 total)