in reply to Re: Moving SQL from perl to Stored Procedures - MSSQL tricks, dynamic paging
in thread Moving SQL from perl to Stored Procedures

Could you show me how do you assign the sort_id in your first strategy? I don't have access to an SQL Server at the moment, but the difference in the speed of those two strategies sound too big. Do you use

declare @paging_buffer table( sort_id int not null identity(1,1) PRIMARY KEY, user_id int not null, firstname varchar(50), lastname varchar(50) );
?

  • Comment on Re^2: Moving SQL from perl to Stored Procedures - MSSQL tricks, dynamic paging
  • Download Code

Replies are listed 'Best First'.
Re^3: Moving SQL from perl to Stored Procedures - MSSQL tricks, dynamic paging
by imp (Priest) on Sep 09, 2006 at 16:05 UTC
    I suspect that I was a fool when I tested that method, and that the sort_id is a perfectly reasonable approach. The dynamic paging text is from something I wrote awhile, and I didn't retest my conclusions - my apologies.

    I'll correct the benchmark data provided and add a note about your correction to the end - thanks for catching my error.

    Update - Redid benchmark

    The sort_id approach works better. Thanks again for pointing out the error.