Forum Replies Created

Viewing 15 posts - 30,766 through 30,780 (of 59,102 total)

  • RE: Parsing tab selimited text into SQL table

    opc.three (3/13/2012)


    If you use SQL Agent, there is no need to introduce an additional programming domain into the call stack. Ditch xp_CmdShell and call bcp from a step with type...

    --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: SQL Like Clause

    anthony.green (3/12/2012)


    you might want to take a look at full text indexing and the contains function then, otherwise you will be wrapping the variable in a multiple of replace statements...

    --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: SQL Like Clause

    marly (3/12/2012)


    seth delconte (3/12/2012)


    marly (3/12/2012)


    I changed it to

    SELECT * from dbo.mytable WHERE FirstName LIKE ‘%’ + REPLACE(@FirstName , ‘%’,’’) + ‘%’ but it still seems to put down the whole...

    --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: Tally OH! An Improved SQL 8K “CSV Splitter” Function

    ErikEckhardt (3/13/2012)


    Jeff,

    I made a few tweaks to your function that I think improve performance a little more:

    • I noticed that the SELECT 0 could be moved from the cteTally table 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: Get month names ordered using recursion

    mtassin (3/13/2012)


    alfredoapereira (3/13/2012)


    but you must have a tally table in your database. and you may not need a calendar table.

    Not true... the Tally CTE outperforms the Tally Table. But...

    --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: Get month names ordered using recursion

    Krtyknm (3/13/2012)


    Yes, rCTE is expensive until if you use only tiny records, I have used only 12 records and i think it is fine..

    Thats a very common misconception especially where...

    --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: Get month names ordered using recursion

    Jonathan AC Roberts (3/13/2012)


    Peformance won't be an issue./code]

    Comparatively speaking, it's a large issue especially if someone uses it for something else, Jonathan. Please see the following article and search...

    --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: Get month names ordered using recursion

    david.howell (3/13/2012)


    Anyway, what you are doing is tiny - only 12 rows so none of this matters.

    ...{snip}... Thanks for the article, it prompted me to read the rCTE BOL entry....

    --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: grant EXECUTE to user on XP_CMDSHELL

    beejug1983 (3/13/2012)


    But it is special request by user which I can not deny. Please let me know how can I give execute permissions on xp_cmdshell to that user.

    Based on...

    --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: Regarding the usage of Temporary table

    GilaMonster (3/12/2012)


    gugan_ta (3/12/2012)


    You can try this..but I'm afraid this can be standard soln...go for ##table

    There is no need for a global temp table here.

    To add to what Gail said, if...

    --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: Sorting comma separated numbers

    Joe,

    That's the old splitter style and it can get really slow. Please see the following article for the improvement of removing all concatenation.

    http://www.sqlservercentral.com/articles/Tally+Table/72993/

    --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: COLUMNS_UPDATED() and Phantom Fields

    If you use, sys.columns, you don't have to worry about such a thing.

    --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 WAITFOR Time

    Also, just in case you forget, why not just build a scheduled job and capture the information every day even though you don't need it for some days. You'd...

    --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: looking to get first sql job

    kareemking (3/11/2012)


    i was wondering, whats the typical hours worked for a dba and a developer?Also please include your years of experience.thanks

    My answer would be "whatever it takes". If you're...

    --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: grant EXECUTE to user on XP_CMDSHELL

    I wouldn't grant EXECUTE privs on xp_CmdShell to anyone. Would your user be happy with a stored procedure that did whatever they wanted to do with xp_CmdShell without actually...

    --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 - 30,766 through 30,780 (of 59,102 total)