SQL Server Performance

Performance of Server Side Cursors

Discussion in 'SQL Server DTS-Related Questions' started by ndramkumar, Jan 26, 2006.

  1. ndramkumar New Member

    I have a stored procedure in one server and a DTS in another server which just calls the stored procedure.

    The logic of the stored procedure is as follows:

    I need to select data from one table and I need to insert those records into a table for a specified date range.

    For example:-
    Date Range : 1/1/2006 and 1/27/2006.
    I am having 10,000 records to select from the source table.

    I need to insert these records for all the days between 1/1/2006 and 1/27/2006.

    So for this I am using a cursor to do the functionality.

    When I exexuted the stored procedure from a DTS (remote server) it took nearly 1 hour and 5 minutes to complete the job.

    Whether there is some other way to achieve the functionality without the cursor.

    It took a long time because of the usage of cursor.

    Please do the needful.
  2. ghemant Moderator

    Hi,<br />Please dont post duplicate threads, find your answers at :<br /<a target="_blank" href=http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=12589>http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=12589</a><br /><br />moderators please lock this threads.<br /><br /><img src='/community/emoticons/emotion-1.gif' alt=':)' /><br />Regards<br /><br />Hemantgiri S. Goswami<br />ghemant@gmail.com<br />"Humans don't have Caliber to PASS TIME , Time it self Pass or Fail Humans" - by Hemantgiri S. Goswami<br />

Share This Page