Forum Replies Created

Viewing 15 posts - 35,356 through 35,370 (of 59,099 total)

  • RE: How to fill in nulls in a set with zeroes?

    CELKO (1/17/2011)


    CASE

    WHEN B.account_change_pcT > 0.1 THEN 'Win'

    WHEN B.account_change_pct < -0.1 THEN 'Loss'

    WHEN B.account_change_pct <= 0.1 THEN 'BreakEven'

    WHEN B.account_change_pct >=...

    --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: Error while executing cursors

    Remove the single quote encapsulation from the table name. Use square brackets, instead.

    --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: Help! SQL select statement for an uncommon task

    picant (1/17/2011)


    ...Okay, any particular order? ... Also,

    why is the Red Apple Sweet and the Green Apple Bitter? Why couldn't it be the other way around? ...

    --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: Database size issue

    Everyone recommending a "shrink" on this thread is forgetting a very, very important thing to do after the shrink... you MUST rebuild your indexes after the shrink. Shrinking an...

    --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: Please help with SQL code

    LutzM (1/17/2011)


    Jeff,

    I'm expecting the sample section to be

    [POL_COUNTRY_CD] [nvarchar](2) NULL,

    [POL_LOCATION_CD] [nvarchar](5) NULL,

    [POD_COUNTRY_CD] [nvarchar](2) NULL,

    [POD_LOCATION_CD] [nvarchar](5) NULL,

    At least that's what the sample data look like.

    The new columns are [POL_LOCATION_CD] and [POD_LOCATION_CD]....

    --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: Please help with SQL code

    pwalter83 (1/17/2011)


    Hi Jeff,

    Thanks for your reply and sorry about not providing the updated tables and sample data. Please find the same here:

    First one is the DHL_TRADE_ASSIGNMENT table-

    -----------------------------------------------------------------

    GO

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER...

    --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: Group Islands of Contiguous Dates (SQL Spackle)

    Sachin Nandanwar (1/17/2011)


    I realize the intentions are good here and thank you for that but there are a couple of problems with the code there. For one, it breaks several...

    --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: Group Islands of Contiguous Dates (SQL Spackle)

    tskelley (1/17/2011)


    rstarr-916208 (1/16/2011)


    Ok, I consider myself duly chastised.

    By the way, what does SLA mean?

    SLA is Service Level Agreement. Basically, a performance and quality agreement between the vendor/programmer and company...

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

    Roy Ernest (1/17/2011)


    Oh yea...!!!! My non technical article is going to be published this week. It will be on 20th - 21st of Jan. It is regarding Netmeeting.

    Thanks Steve.

    Heh......

    --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: Group Islands of Contiguous Dates (SQL Spackle)

    Sachin Nandanwar (1/16/2011)


    Well I just stumbled upon this article.I tried to do it using quirky update method and seems to be working but haven't tested it on a huge no...

    --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: Group Islands of Contiguous Dates (SQL Spackle)

    rstarr-916208 (12/8/2010)


    I ran a test on 500 dates over the span of four years. It returned in 6 seconds. In the environment I come from that would be sufficient 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: Group Islands of Contiguous Dates (SQL Spackle)

    venoym (12/8/2010)


    Great post Jeff!

    I had a thought... this could be extended to account for Times in addition to dates... just move the calculation to the lowest significant field (from day...

    --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 join query help

    joshtheflame (1/15/2011)


    Lutz and Jeff,

    I have only date datatype not time as I dont need time stored in table. Although i always find a problem regarding date formats. I want 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: Please help with SQL code

    LutzM (1/15/2011)


    The sample data can be found here (it's the Edit: 11th post of this thread).

    Heh... I know that, Lutz. 🙂 I was suggesting that the OP repost the...

    --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: Upper/lower case text

    Ok... if I had to write such a thing today, here's how I'd probably write it... it's pretty fast, too, although I'm sure someone will come up with a 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)

Viewing 15 posts - 35,356 through 35,370 (of 59,099 total)