Forum Replies Created

Viewing 15 posts - 54,031 through 54,045 (of 59,072 total)

  • RE: Packing Joins

    Allen,

    I'm not 100% sure because I don't have 2k5, but I don't believe that Ramesh's wonderfully easy to read code is going to do the trick for you because it...

    --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: Use GETDATE() within a UDF

    Jim,

    Is this in reference to the table variable function you created that calls itself?

    --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: Packing Joins

    I don't know what Celko's "Packing Join" is, but I think you're gonna need another column like a date/time or and IDENTITY column even if you were to use 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: Query Help

    "REVERSE" is pretty expensive performance-wise... PARSENAME still does the trick even with the modified list...

    CREATE TABLE dbo.Hits (RowNum INT IDENTITY(1,1) PRIMARY KEY, Site VARCHAR(100))

    INSERT INTO dbo.Hits (Site)

    SELECT 'abc.support.microsoft.com' UNION ALL

    SELECT...

    --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: 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)

Viewing 15 posts - 54,031 through 54,045 (of 59,072 total)