Forum Replies Created

Viewing 15 posts - 871 through 885 (of 1,246 total)

  • RE: Sub-Grouping by consecutive rows

    mishka-723908 (1/22/2016)


    Hello, Thank you for the reply. It did work. This is the way I get the data in the file from a source system and need to properly insert...

  • RE: Sub-Grouping by consecutive rows

    I think this what you're after... Please note that this much easier on later editions of SQL server using the LAG/LEAD functions...

    Some consumable test data...

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

  • RE: Find Latest Date from Multiple Columns

    Orlando Colamatteo (1/19/2016)


    This looks like a place where SQLCLR could come in handy. A function similar to MySQL's GREATEST is what we're looking for.

    +1000...

    Unfortunately a CLR doesn't get you...

  • RE: Find Latest Date from Multiple Columns

    Eirikur Eiriksson (1/19/2016)


    Jason A. Long (1/19/2016)


    Eirikur Eiriksson (1/18/2016)


    Nice idea but I see two potential problems, firstly the costly concatenation and substringing with the data type conversion is going to impact...

  • RE: Find Latest Date from Multiple Columns

    As Mr. Magoo said... Thank you for testing Orlando. 🙂

  • RE: Find Latest Date from Multiple Columns

    Eirikur Eiriksson (1/18/2016)


    Nice idea but I see two potential problems, firstly the costly concatenation and substringing with the data type conversion is going to impact the performance probably more than...

  • RE: Find Latest Date from Multiple Columns

    Just for the fun of it... Here's a solution that uses a cast to binary & contaminate method...

    Test data...

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

    DROP TABLE #temp;

    CREATE TABLE #temp (

    id...

  • RE: How to get Current 3 Business days data

    Quick question... Do you need to exclude holidays as well?

  • RE: Splitting out a row into multiple rows.

    A little "Celko" isn't always a bad thing... I learned a great deal from him when I was first trying to learn.

    Speaking from my own experience... Being told, in no...

  • RE: Date Conversion

    rahulsahay123 (1/8/2016)


    I am getting a data feed with date column of type integer.Format is mmddyyyy.

    Values are like : 01092015

    Now i want to convert this into yyyy-mm-dd ...

  • RE: the use of CTEs

    Jeff Moden (1/7/2016)


    Can't argue that without an example. I'll have to check on some of the execution plans on my prod system. I'm pretty sure I've seen where...

  • RE: the use of CTEs

    I kinda miss Celko... 🙁

  • RE: the use of CTEs

    Jeff Moden (1/7/2016)


    Jason A. Long (12/24/2015)


    Unless you're using recursion, a CTE can be rewritten as a derived table... Considering that derived tables (and CTEs) are processed before the outer query,...

  • RE: Get count of events for each day between 2 dates

    Joe - Thanks for the feedback! Not many people provide feedback or even bother to say "thank you"... Just wanted to let you know that it's appreciated. 🙂

    Since it wasn't...

  • RE: Get count of events for each day between 2 dates

    joe-584802 (1/6/2016)


    Hey Piet thank you for your prompt reply.

    Does that mean I have to create a calendar table that's already pre-populated with dates?

    Is there not a way that TSQL...

Viewing 15 posts - 871 through 885 (of 1,246 total)