Well, paginating data with SQLServer is tricky to do, but it can be done with select statement, without the needing of a stored procedure.
Something like this:
SELECT TOP 1000 -- Number of rows to retrieve
* FROM PERSON WHERE NAME LIKE 'Adam%' AND ID_PERSON NOT IN (SELECT TOP 0 -- Start of the paging
ID_PERSON FROM PERSON WHERE NAME LIKE 'Adam%').
Switching to MySQL is not an option in this project, becoz we would have to switch the entire Public Security from our state to do it so. (something like 900 GB of data).

The datascroller part is something that the previous responses told us how to proceed.

Best Regards

Rafael Mauricio Nami

2006/1/4, Yee CN <[EMAIL PROTECTED]>:
You have to resort to stored procedures to do paging with Microsoft SQL
server. This is an example:
http://weblogs.asp.net/pwilson/archive/2003/10/10/31456.aspx .



Maybe you should consider MySQL? It offers a very convenient "Limit offset,
limit" clause for paging.



Regards,

Yee





  _____

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 3 January 2006 9:37 PM
To: [email protected]
Subject: RE: SQL paging with dataScroller



Paging at the database level is feasible sometimes natively but it depends
what you are using. For example, it's easy with Oracle but not with SQL
Server natively. However, that means that any changes in sorting dynamically
require reordering your recordset to output it properly.



In this case, depending how it's done, it could mean running the query again
with a different SORT clause, which means it could be pretty less efficient
than keeping a map/list of results in a "buffer" that you just play with.
But of course different cases call for different solutions. Maybe you can
elaborate a bit on what you want to do exactly and what you need to provide
(sorting, size of recordsets, etc...)?



If it applies, then I think it should be fairly easy to implement using a
datascroller that is plugged on a bean method that retrieves the required
data on get() probably? I've never personally done it but I believe some
people do it here.



Greg

-----Original Message-----
From: Rafael Nami [mailto:[EMAIL PROTECTED]]
Sent: Tue 1/3/2006 8:23 AM
To: MyFaces Discussion
Cc:
Subject: SQL paging with dataScroller





Reply via email to