Forum Replies Created

Viewing 15 posts - 5,971 through 5,985 (of 26,490 total)

  • RE: enumerating gaps between islands, ideas?

    dwain.c (9/1/2014)


    Not exactly a traditional gaps and islands problem but fun nevertheless. Here's a relatively simple alternative.

    DECLARE @system_log TABLE(

    PK_ID int PRIMARY KEY

    ,Sequence_ID int null

    )

    INSERT @system_log(

    PK_ID

    ,Sequence_ID

    )VALUES

    (1035590, 35587),

    (1035589, NULL),

    (1035586, NULL),

    (1035585, NULL),

    (1035584,...

  • RE: enumerating gaps between islands, ideas?

    Here is a potential solution. It works with the sample data provided.

    DECLARE @system_log TABLE(

    PK_ID int PRIMARY KEY

    ,Sequence_ID int null

    )

    INSERT @system_log(

    PK_ID

    ,Sequence_ID

    )VALUES

    (1035590, 35587),

    (1035589, NULL),

    (1035586, NULL),

    (1035585, NULL),

    (1035584, NULL),

    (1035583, 35583),

    (1035582, NULL),

    (1035581, NULL),

    (1035579, NULL),

    (1035578,...

  • RE: Left excluding join question

    luboxing (8/30/2014)


    Thanks again... However I need the date column from TBL1 so that I get results like:

    DATE LOCATN_K ...

  • RE: Left excluding join question

    It would help if you provided some DDL (CREATE TABLE statement) for the table(s) involved, some sample data representative of the problem domain for the tables (as INSERT INTO statements)...

  • RE: Are the posted questions getting worse?

    LutzM (8/30/2014)


    Lynn Pettis (8/30/2014)


    ...

    Page 1 is now ALL spam.

    Steve wrote a couple of days ago that developers will have a look at it.

    I truly hope that's not the result of...

  • RE: Are the posted questions getting worse?

    Eirikur Eiriksson (8/30/2014)


    Lynn Pettis (8/30/2014)


    The active thread view reminds me of a Monty Python skit: Spam, spam, spam, spam ... :-P;-):w00t:

    The Menu (translated to SSC'lect)

    Post...

  • RE: Are the posted questions getting worse?

    The active thread view reminds me of a Monty Python skit: Spam, spam, spam, spam ... :-P;-):w00t:

  • RE: Are the posted questions getting worse?

    I am jaded. I just read a reopened old thread by one of my favorite people. How, I ask you, can you work with SQL Server and in...

  • RE: converting varchar to datetime

    Interesting thing about storing the DOB as a character string in mmddyyyy format, it is easy to flip it to yyyymmdd and then convert to a date:

    create table dbo.names (name...

  • RE: primary key discussion

    ScottPletcher (8/29/2014)


    Lynn Pettis (8/29/2014)


    ScottPletcher (8/29/2014)


    The page split / fragmentation concern is often overblown. Remember, one INSERT, but you may read the row 1000, 10K, 100K+(?) or more times. ...

  • RE: primary key discussion

    ScottPletcher (8/29/2014)


    The page split / fragmentation concern is often overblown. Remember, one INSERT, but you may read the row 1000, 10K, 100K+(?) or more times. Particularly given the...

  • RE: primary key discussion

    ScottPletcher (8/29/2014)


    Eirikur Eiriksson (8/29/2014)


    ScottPletcher (8/29/2014)


    patrickmcginnis59 10839 (8/29/2014)


    CELKO (8/22/2014)


    What do you use for the PK on lookup tables?

    I use the encoding that is being used. The IDENTITY property (not a...

  • RE: Which perform better comparing only date part of datetime?

    HowardW is correct. The only reason I mentioned the CAST(DateColumn as DATE) alternative is because it is still SARGable. I had to prove it to myself a while...

  • RE: Which perform better comparing only date part of datetime?

    amns (8/29/2014)


    HowardW - Thanks for your tip!

    Lynn Pettis

    Will this

    cast(DateColumn as DATE) = cast(@DateToFind as DATE);

    ???

  • RE: Which perform better comparing only date part of datetime?

    amns (8/29/2014)


    Hi!

    I have a datetime column, to which I just need to compare the date part.

    Which is the way that performs better to get the rows with a specific date,...

Viewing 15 posts - 5,971 through 5,985 (of 26,490 total)