Results 1 to 5 of 5

Thread: Auto Copy Record with recalculation function

  1. #1

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    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.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    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.

  3. #3

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    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.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Auto Copy Record with recalculation function

    Moved to Database Development

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width