|
-
May 29th, 2008, 09:16 PM
#1
Thread Starter
Hyperactive Member
Auto Copy Record with recalculation function
Hi All,
I'm doing a function which can recalculate cost of product in a list. The record of list is storing at database. Since the user would like to recalculate the cost the program will copy exactly same product spec and generate a new reference number without overwrite exist data.
Hence, I had faced a problem with what is best method to reduce the time expand of transaction ?
My suggestion is using store procedure to create a view with new reference number and calculate the changed of product cost. After calculation function is done, the SPROC will copy back the new view record back to table.
it is the best solution ?
can someone provide me better way ?
thanks a lot
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
May 29th, 2008, 09:21 PM
#2
Re: Auto Copy Record with recalculation function
What database is this? Research bulk processing for relevant database. For Oracle, this will involve use of FORALL and BULK COLLECT features.
-
May 29th, 2008, 09:35 PM
#3
Thread Starter
Hyperactive Member
Re: Auto Copy Record with recalculation function
Thanks Leinad31 i'm using SQLExpress 2005 ....
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
May 30th, 2008, 07:48 AM
#4
Re: Auto Copy Record with recalculation function
Moved to Database Development
-
May 30th, 2008, 05:18 PM
#5
Re: Auto Copy Record with recalculation function
The stored procedure is a good start at least as the execution plan gets cached by SQL Server. I'm not sure what you're doing currently that's inefficient. Elaborate.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|