Forum Replies Created

Viewing 15 posts - 54,061 through 54,075 (of 59,098 total)

  • RE: CTE Recursive Query

    Problem with such calcs is that you have to recalculate them over and over. Recommend you take a look at Joe Celko's post on the "Nested Set Model" 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: UDF as UDF parameter performance hit

    I believe you've hit the nail on the head... not sure even a "by value" would help on such a recursive call...

    --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: Another story published!!!

    Outstanding! Congratulations, Brandie!

    --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: Query help needed ...

    I understand what you're trying to do... but I don't understand why. I realize you've made some simplified test data and I appreciate that. There are several answers...

    --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: Query help needed

    I agree with Matt... with the data given, there is no way to relate the correct Discharge to any given Admit... SID certainly won't do it. You need a...

    --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: Join To Find Exclusion

    select a.* from customera a

    join customerb b on (a.company+a.zipcode<>b.company+b.zipcode)

    Ummmm... You might wanna go back and take a look at that code...

    [font="Courier New"]--=====&nbspSetup&nbspa&nbsptest&nbsptable&nbspand&nbsppopulate&nbspwith&nbsptest&nbspdata

    &nbspCREATE&nbspTABLE&nbspCustomersA&nbsp(Company&nbspVARCHAR(5),&nbspZipCode&nbspCHAR(5))

    &nbspINSERT&nbspINTO&nbspCustomersA&nbsp

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp(Company,ZipCode)

    &nbspSELECT&nbsp'AAA',&nbsp'11111'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'BBB',&nbsp'22222'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'CCC',&nbsp'33333'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'DDD',&nbsp'44444'&nbspUNION&nbspALL

    &nbspSELECT&nbsp'EEE',&nbsp'55555'

    --=====&nbspSetup&nbspidentical&nbsptest&nbsptable&nbspand&nbsppopulate&nbspwith&nbspidentical&nbspdata

    &nbsp&nbsp&nbsp&nbsp&nbsp--&nbspexcept&nbspfor&nbspone&nbsprow

    &nbspCREATE&nbspTABLE&nbspCustomersB&nbsp(Company&nbspVARCHAR(5),&nbspZipCode&nbspCHAR(5))

    &nbspINSERT&nbspINTO&nbspCustomersB

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp(Company,ZipCode)

    &nbspSELECT&nbspCompany,ZipCode

    &nbsp&nbsp&nbspFROM&nbspTableA

    &nbsp&nbspWHERE&nbspCompany&nbsp<>&nbsp'CCC'

    --=====&nbspPostIt's&nbspcode

    select&nbspa.*&nbspfrom&nbspcustomersa&nbspa

    join&nbspcustomersb&nbspb&nbspon&nbsp(a.company+a.zipcode<>b.company+b.zipcode)[/font]

    Try this, instead...

    [font="Courier New"]SELECT&nbspa.*

    &nbsp&nbsp&nbspFROM&nbspCustomersA&nbspa

    &nbsp&nbsp&nbspLEFT&nbspOUTER&nbspJOIN&nbspCustomersB&nbspb

    &nbsp&nbsp&nbsp&nbsp&nbspON&nbspa.Company&nbsp=&nbspb.Company

    &nbsp&nbsp&nbsp&nbspAND&nbspa.ZipCode&nbsp=&nbspb.ZipCode

    &nbsp&nbspWHERE&nbspb.Company&nbspIS&nbspNULL[/font]

    --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: Added new columns which now will not accept updates as sa

    ... and lock down the production database... Developers should not have SA privs in the production database and they should not be promoting their own code. Look what happens...

    --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: Beginning Database Design - Spot the Flaws

    Maybe we need to buy in a CRM system?

    Yep... then run it on two Cray's... one for the interface, one for the Data Warehouse 😛 Maybe get 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: Rearrange Identity values

    Heh... yeah, coffee works for me, too. Don't feel bad... I tried the code and had to think about why it wasn't working 😛

    Easiest way to do this is...

    --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: displaying records horizontally

    Rude or unprofessional? Hell, you started it... first you wouldn't answer my simple question even though I gave you an answer that works... good forum etiquette dictates that you...

    --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: displaying records horizontally

    And, yet, my simple question goes unanswered. I just want to know why whoever you're writing this for thinks they need it in such a dumb format. Don't...

    --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: Bulk Insert

    Even with that, it's still gonna blow up... the skipped rows have to have the same format as those that aren't. It's a fault in both Bulk Insert and...

    --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: Rearrange Identity values

    Matt Miller (11/19/2007)


    Jeff Moden (11/19/2007)


    Maybe that works in 2k5... just not in 2k... yeup, I know... it's a 2k5 forum...

    Server: Msg 8102, Level 16, State 1, Line 4

    Cannot update identity...

    --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: Using INSERT between dates?

    Cool... glad to see someone else using a Tally table...

    --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: SEED-y problem

    If you just TRUNCATE the tables, no reseeding is necessary... IDENTITY columns will start over.

    --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 - 54,061 through 54,075 (of 59,098 total)