Forum Replies Created

Viewing 15 posts - 47,116 through 47,130 (of 59,095 total)

  • RE: Bulk Insert Grief

    Jim Russell (11/19/2008)


    Jeff Moden (11/18/2008)


    You don't need a format file for this nor even BCP. Just do a BULK INSET and specify the FIELDTERMINATOR = ''.

    Bringing in the entire...

    --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: getting rid of 0's in the start of a varchar(6) column

    Rajesh (11/19/2008)


    I am sorry, little confused with the reply. Could you be specific, what's the input and what needs to be the op with few examples. If the the volume...

    --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: Tips for New DBAs

    SQLBOT (11/19/2008)


    Peter,

    I think you'll like the next article which is about knowing what is the DBA's responsibility and saying "NO!" to what's contradicts CIA and the systems you have...

    --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: Select based on Date- How to?

    mpdillon (11/19/2008)


    A friend suggested the following. It seems to be cleaner than mine.

    Where cast(varchar(8),EndDt,112) <= Format('01/02/2009',"yyyyMMdd") Sorry for mixing T-SQL and VB.

    However, both Jeff and Lynn bring up the issue...

    --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: Select based on Date- How to?

    Lynn Pettis (11/19/2008)


    shailesh (11/19/2008)

    Where dbo.ufn_GetDateOnly(EndDt) <= '01/01/2009'

    And doing this can result in your query not taking advantage of indexing on a table. If your tables are small, 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 NULL as the last row + ORDER BY

    Zactly... 🙂

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

    Hey, Naked Ape and BitBucket... thanks. It's folks like the two of you that make this all worthwhile. 🙂

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

    GilaMonster (11/19/2008)


    Jeff Moden (11/18/2008)


    consider the answer that one wiz kid gave...

    "You should be using derived column transformation, and use substring or available string functions. This would help." ... 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: MS SQL Aggregate Function

    kmohan39 (11/19/2008)


    Hello there,

    This is the Task:

    Select the title_id, type, and price from the titles table along with an average price for all tables

    Not what I asked for... 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: The Joy of Numbers

    I've just gotta ask... what did you need the 1 Billion row numbers table 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: Can Express write to 2005 tables?

    Ok... I think I found an answer that's good enough... the feature list at the following URL says that "Distributed Queries" are supported in SQL Server Express...

    http://msdn.microsoft.com/en-us/library/ms143761(SQL.90).aspx

    ... and BOL says...

    --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: Faster Deletes

    Dugi (11/19/2008)


    wOOOps I didn't see the nr of records for deletion! Sorry for that! This is the reason that the suggestion must tested on the test environment to be sure...

    --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 with Money and Decimal datatype

    The answer is that you probably want to line up decimal points among all values with commas, anyway. So, do this...

    [font="Courier New"]SELECT REPLACE(STUFF(STUFF(STUFF(STR(1234.7656422,16,4),9,0,','),6,0,','),3,0,','),' ,',' ')[/font]

    Still want to know...

    --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 with Money and Decimal datatype

    karthikeyan (11/18/2008)


    Hi All,

    I have the below scenario.

    select convert(varchar(30),convert(decimal(18,4),234543242.7656422),1)

    is showing

    234543242.7656

    Since i need the result set with comma seperated i used the below query.

    select convert(varchar(30),convert(money,234543242.7656422),1)

    is showing

    234,543,242.77

    But.... The problem is it 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: Faster Deletes

    If you want to delete only 37,000 rows, it should take only six seconds. Do you have any triggers on the table? Does anyone have an uncommitted transaction...

    --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 - 47,116 through 47,130 (of 59,095 total)