Forum Replies Created

Viewing 15 posts - 2,116 through 2,130 (of 59,067 total)

  • Reply To: Generation of Auto Series based on logic

    Just for convenience, here's the formula.  Replace the "t.N" with the name of your IDENTITY column that starts at zero.

    CONCAT('10.',CHAR(66+t.N/1000),RIGHT(CONCAT('00',t.N%1000),3))

    EDIT:  Forgot to add that it would be...

    • This reply was modified 3 years, 5 months ago by Jeff Moden.

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

  • Reply To: Generation of Auto Series based on logic

    Yes.  And, it's easy.  Start an IDENTITY column at "0".  Add a computed column with the formula from my previous query but replace the "t.N" in both places with 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)

  • Reply To: The Time Conversion

    Too funny.  I wish it returned an error instead.  One that says, "Dude!  Just because this is 2022, you shouldn't expect anything different here!" 😀

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

  • Reply To: BCP OUT xp_cmdshell errors out maximum column

    I guess I don't understand why you think that you need to list every column.  If you're trying to export the whole table, then export the whole 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)

  • Viewing 15 posts - 2,116 through 2,130 (of 59,067 total)