Forum Replies Created

Viewing 15 posts - 91 through 105 (of 303 total)

  • RE: There Must Be 15 Ways To Lose Your Cursors… Part 2: Just Put It in a S

    Thomas (4/27/2009)


    Note that the comma-delimited list is sorted alphabetically. I'm aware that there is a hack using Replace, Stuff and For Xml to achieve this but it is pretty...

  • RE: There Must Be 15 Ways To Lose Your Cursors... part 1, Introduction

    bruce.trimpop (4/24/2009)


    Here's the point I was trying to make. Some people work in an environment where there are time constraints and other issues completely out of their control,...

  • RE: Help Solving Running Total Problem

    RBarryYoung (4/21/2009)


    Goldie Graber (4/21/2009)


    Also, Barry, would you be able to explain your query?

    Sorry Goldie, not trying to be evasive but my brain isn't at 100% right now and this technique...

  • RE: Help Solving Running Total Problem

    Lynn Pettis (4/21/2009)


    Goldie Graber (4/21/2009)


    Bevan keighley (4/21/2009)


    Hi Goldie,

    Do you have an index on UserID?

    Yes, Non-Unique, Non-Clustered.

    That is the problem. For the "quirky update" to work you need a clustered...

  • RE: Help Solving Running Total Problem

    Bevan keighley (4/21/2009)


    Hi Goldie,

    Do you have an index on UserID?

    Yes, Non-Unique, Non-Clustered.

  • RE: Help Solving Running Total Problem

    Lynn Pettis (4/21/2009)


    I'm not sure why it isn't working for you. I run the above code as is and it works correctly with the test data.

    Can you post the...

  • RE: T-SQL 2005 UPSERT help

    James.N (4/21/2009)


    HI,

    Waht am I trying to accomplish , with the code I posted ?

    First I am updating the Rows that are common in both TestD(Destination)...

  • RE: Help Solving Running Total Problem

    Lynn: I can't get your solution to work correctly. GroupCounter is always 1 on my live data. I can't understand it.

    Barry: As I suspected, it looks like your solution out-performs...

  • RE: T-SQL 2005 UPSERT help

    James.N (4/21/2009)


    I already have a upsert code in Test with Inner join, then deleting the common records and then insert,

    and this code is working fine with out any issues.

    UPDATE D...

  • RE: T-SQL 2005 UPSERT help

    James.N (4/21/2009)


    Nope, the above loig in not working either . It giving an error Msg 4104, Level 16, State 1, Line 1

    "UPDATE TestD

    SET TestD.cola=testS.col1,

    TestD.colb=testS.col2

    ...

  • RE: Convert UTC Time to Pacific Time Query:crazy:

    kylemwhite (4/20/2009)


    If you are only concerned with dates after 2006, the Microsoft functions will probably be accurate. If, however, you have historical data, then do not trust the Microsoft functions....

  • RE: Help Solving Running Total Problem

    RBarryYoung (4/20/2009)


    I believe that this will do the job:

    SELECT Distinct UserID

    From (

    SELECT *

    , ROW_NUMBER() Over(partition by UserId, Comment, CmtTypeGrp order by CheckInID) as GrpCnt

    From (

    SELECT CheckInID

    , UserID

    , comment

    ,...

  • RE: Help Solving Running Total Problem

    Jeffrey Williams (4/20/2009)


    Based upon your sample data - you don't have a primary key. The examples given here don't include a primary key definition.

    My bad. Here's the same table...

  • RE: Help Solving Running Total Problem

    Lynn Pettis (4/20/2009)


    Sounds like you need to redefine your problem somewhat. How about providing something closer to the actual problem we are working on. Can you give me...

  • RE: Help Solving Running Total Problem

    Jeffrey Williams (4/20/2009)


    I see how you have defined this as 3 consecutive rows - but, how is the system supposed to do that? What columns define the order...

Viewing 15 posts - 91 through 105 (of 303 total)