Objectdatasource updating input parameters

This requires a complete table scan on the data to be paged through.Instead, we can create the table variable to hold only the primary key column(s) of the table to be paged through.In the New stored procedure results, the percentage improvement over the old approach is included for reference: column and the index could be scanned when finding correct subset of records in the final query.

This approach works great if there are no holes in primary key column values of the data being paged through. For example, if Sam Lee and Hans Smith were fired, our You can learn more about Daniel's stored procedure in Paging through Records using a Stored Procedure; the stored procedure's contents can be viewed in their entirety here.For example, searching for "Microsoft" on Google returns approximately 2,190,000,000 results, but thankfully Google only shows me ten of those at a time. NET 2.0 providing two paging flavors: While default paging is quick and easy to implement, for sufficiently-sized result sets custom paging is a must.When providing paging access to particularly large result sets - tables with tens of thousands, hundreds of thousands, or millions of records - care must be taken in querying the data such that only the particular page of data requested is returned. In March 2006 I authored a couple of articles here on 4Guys on how to efficiently page through large result sets using custom paging in the Grid View with the Object Data Source and SQL Server 2005's new keyword.for a more thorough discussion on this topic.) Second, rather than using a temporary table, let's use a table variable.

Moreover, Microsoft recommends: "use table variables whenever possible except when there is a significant volume of data and there is repeated use of the table." Since this stored procedure just dumps data into the temp table once, reads from it, and then is done with it, using a table variable would adhere to Microsoft's recommendation. NET 2.0 the custom paging logic used by the Object Data Source and Grid View defines the records to access not by page index and records per page, but by the start row index and the maximum number of rows to return.

Modernizing Daniel's Stored Procedure Before we look at improving the performance of Daniel's stored procedure, let's first modernize it a bit.