Forum Replies Created

Viewing 15 posts - 20,911 through 20,925 (of 59,072 total)

  • RE: What is a "set-based loop?"

    Alan.B (4/26/2015)


    Over the past year I have heard some folks around here talk about a "set based loop". What's that all about? Can someone provide an example?

    There are two types...

    --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: Embrace Stored Procedures

    xsevensinzx (4/26/2015)


    Jeff Moden (4/26/2015)


    xsevensinzx (4/25/2015)


    ...if someone came to me and said that the database can store no logic, then it's not the end of the world.

    BWAAAHAAAA!!! If someone gave...

    --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: Embrace Stored Procedures

    xsevensinzx (4/25/2015)


    ...if someone came to me and said that the database can store no logic, then it's not the end of the world.

    BWAAAHAAAA!!! If someone gave me such ridiculous...

    --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: Running Balance Updation

    vikramchander90 (4/26/2015)


    I have below table and few rows as eg

    Create Tableledger

    (

    row_noint,

    acct_idvarchar(255),

    debitnumeric(28,2),

    creditnumeric(28,2),

    balancenumeric(28,2)

    )

    row_noacct_idtran_descdebitcreditbalance

    0Account1Opening BalanceNULLNULL1000.00

    0Account2Opening BalanceNULLNULL500.00

    1Account1SOBI0.00200.00NULL

    2Account1SNP300.000.00NULL

    1Account2SNP100.00200.00NULL

    I need to update the balance column as running balance based on acct_id column as previous balance +...

    --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: Creating Mutliple Logins

    Eirikur Eiriksson (4/26/2015)


    Jeff Moden (4/24/2015)


    Yeahhhh.... PoSH... NOT! 😉

    Surely you meant "Not posh enough":-D

    😎

    normally do these things on linux using sqsh[/url].

    Don't call me "Shirley". 😉

    --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: Creating Mutliple Logins

    Thanks for the feedback, Steve.

    As for the "user" part of this, we also used similar code to create the code at the DOS level to create the AD users 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: How do I find out if I double loaded a file, programmatically?

    DSNOSPAM (4/24/2015)


    I was just doing a table import task (right click database name/Tasks/Import Data), not knowing my boss had just loaded the same file. it did not warn me...

    --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: Table Function question

    That's the whole idea here! 🙂

    Thank you for the feedback and please post back if you have more questions on this problem. And, if the function has the word...

    --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: Table Function question

    adam-639168 (4/24/2015)


    Thanks, I was hoping there would be some kind of loop (beyond my level) or something that could iterate through each account.

    Ideally, I'd like to avoid creating a duplicate...

    --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: Creating Mutliple Logins

    Yeahhhh.... PoSH... NOT! 😉

    If they're just test users that will go away right after you're done testing, then something like the following might do.

    DECLARE @sql VARCHAR(MAX)

    ...

    --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: split a comma separated string into columns

    To be honest, the front end is storing the data incorrectly. The data should be sorted with just one IP address per row and, once the table is properly...

    --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: Importing Large Datasets

    BSavoie (4/24/2015)


    Hi Jeff, thanks for the reply. I'll work on tracking down those specifics for you by tomorrow. What I can tell you so far is that the files are...

    --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: how to assess a sql expert for a job?

    sqlguy-736318 (4/23/2015)


    Hi, I need to create a job description for a SQL developer. My company has several applications which use stored procs so we're going to hire a SQL...

    --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: Your Role Is Changing

    Gail Wanabee (4/23/2015)


    Teamwork is what works in all well implemented work environments. It has nothing to do with DevOps.

    Heh... that's precisely what I'm talking about. Most people make 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)

  • RE: Code Reviews

    We do 100% code reviews on any and all things SQL. That includes me and I'm the DBA. I do NOT make production code or data changes without...

    --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 - 20,911 through 20,925 (of 59,072 total)