updating a table using stored procedure cursors
Posted on 2006-11-22
I know I can do this in vb code however I'm wondering if a stored procedure could take care of this for me. I have to go through a table and grab the people that moved out this month. This table has no resident information just the apartment information. Now I have all units that had moveouts for the month. Then I need to grab just 1 name out of the occupants table so that the moveout has a name. There may be move then 1 person for that unit in the occupant table however I only need 1. Then I have to go to openitems table and get the open items from this unit. So I basically end up with getting the moveouts with a name and then getting all the open items that this unit is has. (open items are passed due invoices). I would then like to update a temp table that I can use to print a report from. Like I said I know I can do this in code, but I think a stored procedure could handle it just wondering how to do it.