Forum Replies Created

Viewing 15 posts - 991 through 1,005 (of 6,036 total)

  • RE: Overlapping datetime ranges.

    ben.brugman (1/6/2017)


    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...

  • RE: Date logic

    KGJ-Dev (1/9/2017)


    Hi Luis,

    thanks for the reply and i would like to put my requirement in detail. please note i have updated my sample on the first post.

    select * from...

  • RE: replace null with another column

    MMartin1 (1/9/2017)


    You forgot the NOT.

    SELECT CASE WHEN NULL IS NOT NULL THEN NULL ELSE NULL END;

    How about

    SELECT CASE WHEN NULL IS NOT NULL THEN NOT NULL ELSE NULL END

    ?

    same...

  • RE: Need Help with Stored Procedure Data type converting

    Newbi (1/4/2017)


    This is my stored procedure using inside my RDL Report

    USE [Invoice]

    GO

    SET ANSI_NULLS OFF

    GO

    SET QUOTED_IDENTIFIER OFF

    GO

    ALTER PROCEDURE [dbo].[uspInvoiceLines]

    ( @InInvoiceNbr int

    ,@InLinesPerPageint

    )

    AS

    DECLARE @TotalRows int

    DECLARE @Remainder int

    DECLARE @NumPages int

    DECLARE @NextPageRows int

    set @TotalRows=...

  • RE: Remove certain characters from a string

    Eirikur Eiriksson (1/5/2017)


    Here is a quick solution that uses the dbo.DelimitedSplit8K function[/url]. Note that for this to work, the values cannot contain spaces!

    😎

    DECLARE @Text VARCHAR(256) = 'Generic="abcde" Generic="fghij" Generic="sdfsdfasdf"';

    SELECT

    ...

  • RE: Deadlock Problem on a Heap Table

    TheSQLGuru (1/1/2017)


    Sergiy (1/1/2017)


    Every index has statistics on it, and statistics could suggest optimiser that the date selection is ultimately selective.

    I'm sorry Sergiy, but that is absolutely not the case. The...

  • RE: Deadlock Problem on a Heap Table

    TheSQLGuru (12/31/2016)


    Jeff:

    "If the NCI had a leading column of the TrackingNumber and there's only one of each tracking number in the table, how do you figure that would result in...

  • RE: Deadlock Problem on a Heap Table

    lmarkum (12/30/2016)


    However, I need to solve the deadlock issue,

    Then you need to fix the code.

    Look what people told you:

    Jeffrey Williams 3188 (12/29/2016)


    You need to fix this issue:

    CONVERT(datetime,PackageActivityDateTime,...

  • RE: Deadlock Problem on a Heap Table

    TheSQLGuru (12/30/2016)


    lmarkum (12/30/2016)


    Sergiy (12/30/2016)


    lmarkum (12/23/2016)


    I also dropped the non-clustered index IX_UPSTracking on just TrackingNumber since that seemed redundant to the new clustered PK and another existing index...

  • RE: Deadlock Problem on a Heap Table

    lmarkum (12/23/2016)


    I also dropped the non-clustered index IX_UPSTracking on just TrackingNumber since that seemed redundant to the new clustered PK and another existing index IX_UPSTracking on TrackingNumber,...

  • RE: Deadlock Problem on a Heap Table

    When you're talking to the developer, on a side note, ask them - have they ever heard about data normalization?

    That boring concept really helps in preventing deadlocks.

  • RE: Application Upgrade and Index Rebuild

    chuck.forbes (12/28/2016)


    We're in the midst of an application upgrade, and part of the vendor instructions after the database pieces are upgraded is to rebuild all indexes, for improved performance.

    Feel...

  • RE: Are the posted questions getting worse?

    I've got mine removed 15 month ago.

    3 days in hospital, 1 of them because the operation was delayed.

    Was quite painful for a week - one of the holes did...

  • RE: Overlapping datetime ranges.

    ben.brugman (12/22/2016)


    But this does not give the correct number of rows.

    And the data within the rows (newFromValue) does not make sense to me.

    Because of the group by data gets 'lost'.

    So...

  • RE: Overlapping datetime ranges.

    ben.brugman (12/22/2016)


    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,...

Viewing 15 posts - 991 through 1,005 (of 6,036 total)