Forum


18:28

All the demo's use MySQL and that Bloody nice LIMIT function for doing the paging of data. We are trying to implement the large data (12000 records) example in ASP using ACCESS & MSSQL (we got it all working with mySQL but project has to be MSSQL/ACCESS only)
They do not have the equivalent LIMIT functionality, (No! TOP WILL NOT WORK after reading 1000 forum posts). As Jqgrid is independant of what ever server-side DB/Language, why is it so reliant on the limit function of mysql how do we do a large database without/with pagination but are able to do the auto search function like in bigset.html.
Regards
MArk
04:47

Moderators
30/10/2007

Hello,
I will just give you the point – you will do the rest:
So let suppose that we want to emulate the following mysql sql
select * from mytable limit 10, 20
In MSSQL this can be done like this:
select top 20 *
from
(select top 30 *
from mytable
order by sortname)
order by sortname sortorder
If you use MSSQL 2005 you can read more here
http://www.select-sql.com/mssq.....-2005.html
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
06:11

Hi Tony, thanks for reply.
I have seen both code examples before and neither work properly (access), mssql link has it's limits.
select * from mytable limit 10, 20
Start from record 11 and give us the next 20 records (11-30)
In Access and MSSQL your example will not start from a given record point, for example if we have 12000 records like the bigset examples, then doing:
select top 20 *
from
(select top 30 *
from tblInvoice
order by invid)
order by invid asc
will always give us records 1-20 as the TOP 30 is just reducing the 12000 records to the top 30 right?
Or our we missing something obvious? sortorder? different sortfield? remembering we want to use 12000 records and paginate them like the examples.
Will always give you records 1-20 when really your after records
At the moment our database will probably star with 1000 records but future grow to 10000 so we might see how long it takes to just do a once load all records, as we really need scrolling loading no paging with the auto increment search facility like in the examples.
We'll have a play with the demo's.
Regards
Mark C.
07:17

Moderators
30/10/2007

Hello,
Sorry - you are right. I do not have work long time with MSSQL, so this was first that I have in mind.
Googling it I found this: http://www.planet-source-code......8;lngWId=5
SELECT TOP [x] [fields]
FROM [table]
WHERE ([clause])
AND [pKey] NOT IN (
SELECT [pKey] FROM (
SELECT TOP [y] [fields2]
FROM [table]
WHERE [clause]
ORDER BY [sort]) as [Tbl1])
ORDER BY [sort]
[x] = num rows
[y] = 0 based offset
[fields] = fields you want
[table] = table / joins / whatever
[clause] = where clause
[pKey] = primary key of table / virtual view in [table]
[fields2] = Only requires [pKey] and [sort] columns
[sort] = normal sort. Identical for both incl. ASC / DESC
[Tbl1] = name doesn't matter, it's for parser, not for you.
Hope this will help.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
55 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66