Forum Replies Created

Viewing 15 posts - 1 through 15 (of 18 total)

  • RE: update 2 tables at once

    I was able to fix that scenario by changing the over order by line to amount not ID. That fixes one record but still leaves another record broken.

    declare @Pledge...

  • RE: update 2 tables at once

    Here is a good example of where this syntax is overpaying. I think it has something to do with the over (row number) line but I'm not 100% sure....

  • RE: update 2 tables at once

    I have been looking at this and looking at it and it works great for my test data that I provided here but in some client data I have it's...

  • RE: update 2 tables at once

    WayneS (2/25/2010)


    ray-SQL (2/25/2010)


    Try this, not sure it handles all of your scenarios, so more sample data would be good. But it is working for what you given us.

    I've modified what...

  • RE: update 2 tables at once

    ray-SQL (2/25/2010)


    Please try my modified code above, now with your data and added a fix for updating the received amount on Pledge table.

    Thank you

    I'll give it a try. I'm...

  • RE: update 2 tables at once

    Ok, here is some good sample data. I have some here where an acct made more than 1 pledge on the same day with the same fund. There...

  • RE: update 2 tables at once

    I do database conversions where I take historical client data who purchase our software and make it fit our system. Sometimes the client data isn't very rationalized. This...

  • RE: update 2 tables at once

    WayneS (2/25/2010)


    First, please provide the table structure information, and test data via "CREATE TABLE" / "DECLARE @TableVar TABLE" and "INSERT" statements (see the first link in my signature for how...

  • RE: update 2 tables at once

    The relationship between the tables is acctid and fundid. The payment.date can be >= pledge.date never less than.

  • RE: update 2 tables at once

    It's unusual to have money left over. It does happen once in awhile. Where someone decides to pay more than they promised. In that scenario we raise...

  • RE: update 2 tables at once

    In the scenario posted my accountid's match as well as my fundid and dates.

    In real life all of the above is true except the payment date may be...

  • RE: update 2 tables at once

    No insert can occur. The tables already exist with data in them. I have no control over that.

  • RE: Why is this slow?

    So let me ask a follow up question. Under what circumstance would a cursor be good? Small data set?

  • RE: Why is this slow?

    Yep I know what a tally table is. I've been reading the forums in my spare time (what there is of that). 🙂

  • RE: Why is this slow?

    I learned cursors stink ... and I learned the hard way what is meant by RBAR. :laugh:

    Actually though this is really going to help. In the 2 weeks...

Viewing 15 posts - 1 through 15 (of 18 total)