Forum Replies Created

Viewing 15 posts - 38,641 through 38,655 (of 59,098 total)

  • RE: Cross Tabs and Pivots, Part 1 – Converting Rows to Columns

    fhljudyfong (5/4/2010)


    I have a problem with the cross-tab. My records in the table are the in out records of each staff. Here are sample data:

    Staff IDDate Time

    426/04/201009:36:00

    426/04/201013:11:00

    426/04/201014:49:00

    426/04/201017:59:00

    427/04/201009:37:00

    427/04/201013:18:00

    427/04/201014:22:00

    427/04/201018:08:00

    428/04/201009:40:00

    428/04/201013:03:00

    428/04/201014:47:00

    428/04/201018:38:00

    429/04/201009:36:00

    429/04/201013:04:00

    429/04/201013:58:00

    429/04/201018:37:00

    526/04/201008:47:00

    526/04/201013:05:00

    526/04/201013:38:00

    526/04/201017:50:00

    527/04/201008:53:00

    527/04/201013:01:00

    527/04/201013:36:00

    527/04/201017:50:00

    528/04/201008:57:00

    528/04/201013:02:00

    528/04/201013:03:00

    528/04/201013:30:00

    528/04/201017:46:00

    529/04/201009:09:00

    529/04/201013:03:00

    529/04/201014:29:00

    529/04/201018:02:00

    529/04/201018:03:00

    Would like...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Missing numbers in a series

    rajesh.subramanian (5/4/2010)


    DECLARE @Numbers TABLE (N INT)

    DECLARE @MissingNumbers TABLE (N INT)

    Declare @vMax int

    Declare @vMIn int

    INSERT INTO @Numbers

    VALUES (50000001),(50000002),(50000019),(51000000)

    --VALUES (1),(2),(19),(20)

    Set @vMax = (Select MAX(N) from @Numbers)

    Set @vMin = (Select MIN(N) from @Numbers)

    while(@vMax...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Minimising use of tempDB during large INSERT

    Drammy (5/4/2010)


    I was only querying about tempDB

    I don't see a lot in your query that would cause any huge TempDB problems unless most of the tables number in the millions...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Optimization: DE-Delimiting a Semi Colon Delimited List

    Paul White NZ (5/3/2010)


    Nine times out of ten a SQLCLR solution is faster than the Tally table and uses fewer resources:

    ... for string splits.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Missing numbers in a series

    Ok... here's a test table with some huge gaps over a huge range of numbers along with some single row gaps. The code takes about 12 seconds to run...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: How long to build index

    SQLJocky (5/3/2010)


    Is there anything that can tell me how long it might lock down my table if I add a new index? We are running 2005 Standard so I...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: How to avoid this dead lock?

    It tells you what the database ID is and it tells you the proc IDs AND it tells you the code snippets for the deadlock participants... next step is to...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: combine two subjects of same field type on one row

    reg 18234 (5/3/2010)


    ColdCoffee (5/3/2010)


    Quite possible, buddy.. but you will have to tell us atleast the description of the house; we ourselves will find out the address and the fastest way...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Missing numbers in a series

    Folks, I think that just about anything with any form of a Tally table is the wrong way to do it here especially if you have very large gaps for...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Missing numbers in a series

    gurukiran.bhat (5/3/2010)


    following method worked out for me

    for this example i have used table called table1 which has single column column1.

    create table table1

    (column1 int)

    I have inserted values...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Hiding payroll data from admin

    Heh... some VERY interesting thoughts on this thread... particularly the idea of having a 3rd party doing the administration. I'v been through that several times. My question would...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Index on Date Time Column Not Getting Used

    uppal.kunal (5/3/2010)


    Same query in oracle does refer to index.. so there is something which Sql server does differently

    Yes, it IS different. It's been a long time since I've worked...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs

    Thanks for the feedback Jason and Peter.

    Rumor has it that Steve is working on making a couple of training "movies" for the two articles in this series. He's pretty...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Are the posted questions getting worse?

    Steve Jones - Editor (5/2/2010)


    I've seen a couple incidents of plagiarism lately on different sites. Not all from this site, but a few places that have copied info from MSDN/Technet,...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: The Cost of Data Loss

    Heh... I read 1984, "Enemy of the State" is one of my favorite movies, and I can certainly understand Tom's sentiment on this. I also have a grand appreciation...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 15 posts - 38,641 through 38,655 (of 59,098 total)