pysome has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
Now ,i am lost in a MS-SQL store procedure and Perl program.

My DB server is MS-SQL,Other guys writed a soooooo long store procedure to perform some biz function.It spend about 3 hours every running! Now,I need to rewrite it by perl.I take a whole day to review the store procedure,it is 500 lines or so. It builds up about 20 #temp tables and then do some joining,selecting,updating,deleting...

My thought is :
1)To store enormous recoreds(tables) into my local DB Sqlite.
2)To store small records(talbes) into Memory.
3)Then execute other function,such as :select,delete,update,sum etc.

How about my method? Can anyone has approximate experience,pls give me a hand,TIX.

20070809 Janitored by Corion: Added formatting as per Writeup Formatting Tips

Replies are listed 'Best First'.
Re: Store Procedure or Perl program?
by perrin (Chancellor) on Aug 09, 2007 at 14:15 UTC
    You haven't told us what problem you're trying to fix. Are you trying to make it faster? Why do you want to use SQLite if you already have MSSQL?
Re: Store Procedure or Perl program?
by jfroebe (Parson) on Aug 09, 2007 at 18:42 UTC

    A number of questions for the original poster:

    1. Why rewrite the stored procedure in Perl?
    2. Have you tried optimizing the stored procedure?

    Not exactly sure why you're trying to reinvent the wheel here. Can you elaborate a bit more?

    Jason L. Froebe

    Help find a cure for breast cancer! Net proceeds benefit the Susan G. Komen Breast Cancer Foundation and the National Philanthropic Trust. Help by donating - I'm walking 60 miles in 3 days in August 2007. (The day I return from TechWave is the first day of the Walk).

    Blog, Tech Blog

      1.I wanna to lighten the MSSQL task.Since so many stored procedure have run in DB SERVER already. 2.Control all my DB operation in one server. I just want to "translated" the stored procedure into Perl program now.Is it feasible?