If a table contains 20000 records . In a page at each time
100 records to be displayed. What are the steps u will take
to improve performance? will you use dataset or datareader?
Answer Posted / renjith t n
You need to look at ROW_NUMBER() to do this effectively.
Temp tables, cursors are to costly.
CREATE PROCEDURE myProc
@StartIndex INT
@MaxRecords INT
AS
SET @StartIndex = @StartIndex + 1
SELECT
first_name,
last_name,
middle_init
FROM
(SELECT
first_name,
last_name,
middle_init
ROW_NUMBER() OVER(ORDER BY last_name)
AS rownum
FROM
Users)
AS Users
WHERE
rownum between @StartIndex and (@StartIndex + @MaxRecords) -
1
Then we can use Dataset for best performance..
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is ole db and odbc?
Can you explain how to enable and disable connection pooling?
What do you know about ado.net's methods?
How to bind the controls(best practice) comboboxes to the data in the dataset?
What is data relation?
Can we do database operations without using any of the ado.net objects?
What is difference between Dataview and Datatable?
Describe the command object and its method.
Difference between sqlcommand and sqlcommandbuilder?
What are the methods of XML dataset object?
What is the DataTableCollection?
Command objects uses, purposes and their methods.
Explain executenonquery?
What are three methods for displaying data in a syncfusion datagrid
What is the difference between Datareader and Dataset?