I know there is a simple answer to this, but I can't seem to get to it today.
I have an Assets table that contains (among other things) the original cost, Accumulated depreciation, and net book value. I need to update the accumulated depreciation & NBV based on the sum of posted records in the DepnEntries table. AssetId is the primary key in the Assets table, and a foreign key in the DepnEntries table.
I thought to loop though the Asset records that need to be updated using an update cursor, but a little voice is telling me there is a better way.
If anyone could point me in the right direction, I would be ever so grateful.
This is running on a SQL Server 2005 database.
Cheers, Rissa
I have an Assets table that contains (among other things) the original cost, Accumulated depreciation, and net book value. I need to update the accumulated depreciation & NBV based on the sum of posted records in the DepnEntries table. AssetId is the primary key in the Assets table, and a foreign key in the DepnEntries table.
I thought to loop though the Asset records that need to be updated using an update cursor, but a little voice is telling me there is a better way.
If anyone could point me in the right direction, I would be ever so grateful.
This is running on a SQL Server 2005 database.
Cheers, Rissa