Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Large amounts of data in C#?
Message
From
15/03/2016 12:27:36
 
 
General information
Forum:
C#
Category:
Databases
Miscellaneous
Thread ID:
01632951
Message ID:
01633121
Views:
59
>>>is that mean that c# doesn't have this features???
>>
>>No. The default paging retrieves *all* records then pages through the result
>
>One note - the link you provided uses the standard paging approach found in SQL Server 2005-2008R2 (materializing a ROW_NUMBER value and then querying on it). That certainly works. I had to use that for years.
>
>In SQL 2012, Microsoft implemented offset/fetch capability directly into the SELECT statement, so that someone could grab a segment of rows without needing a common table expression or subquery.
>
>For instance, here's something that would read the 2nd page of data, in a result set scheme that shows 20 rows per page:
>
>It performs roughly the same as the SQL 2005 approach, so there's no direct performance benefit. Just simply eliminates the need for a subquery.
>
>
>   declare @PageNumber int =2
>   declare @RowsPerPage int = 20
>
>   select BusinessEntityID, AccountNumber, Name, 
>         ROW_NUMBER() OVER (ORDER BY Name) as RowNum
>         from Purchasing.Vendor Order by Name
>         offset (@PageNumber-1) * @RowsPerPage rows
>     fetch next @RowsPerPage rows only
>
>
Interesting, thanks. As you may remember my SQL knowledge is negligible (at best :-{ )
Previous
Reply
Map
View

Click here to load this message in the networking platform