Click here to Skip to main content
15,915,702 members
Home / Discussions / Database
   

Database

 
GeneralRe: resetting id after deleting records Pin
Rashid Thadha21-Nov-01 4:19
Rashid Thadha21-Nov-01 4:19 
GeneralDatabase pagination Pin
JEi16-Nov-01 0:31
JEi16-Nov-01 0:31 
GeneralRe: Database pagination Pin
Chris Maunder16-Nov-01 0:56
cofounderChris Maunder16-Nov-01 0:56 
GeneralRe: Database pagination Pin
JEi16-Nov-01 1:10
JEi16-Nov-01 1:10 
GeneralRe: Database pagination Pin
Andrew Peace24-Nov-01 4:13
Andrew Peace24-Nov-01 4:13 
GeneralRe: Database pagination Pin
blueei5-Dec-01 21:59
blueei5-Dec-01 21:59 
GeneralRe: Database pagination Pin
Nick Parker30-Nov-01 8:40
protectorNick Parker30-Nov-01 8:40 
GeneralDatabase pagination Pin
JEi16-Nov-01 0:27
JEi16-Nov-01 0:27 
Hi all, I'm actually designing an internet application, and I'd like to know how to paginate the information retrieved from the database.

The problem is that I access a huge database (SQLServer 2000) and I don't want tho get all the records everytime I execute a query, I'd like to paginate the records and get them in different queries. I've thought of two methods to do that and I'd like to know which one is better, so if anybody knows it (or knows another way to solve it) please help me!

1.
Use SQL queries of the type

SELECT TOP x
FROM aTable
WHERE aTable.Id > @LastIdReceived

The problem I find in this method, is that I'm accessing a huge table (about 900.000 records) and is a complicated query (with Joins to a lot of other tables) so I think that if I do it this way, each time I have to execute the full query (and there's also the fact that with this way I can't know before the total amount of records affected by the query, I could do a COUNT first, but this would be another query)

2.
Create a temporary table of indexes with the query I need and then, retrieve the information I need by joining it with the real table (with the amount of records I need). The problem I see this way is that if there are a lot of users asking for queries at the same time, creating so many temporary tables might be inefficient.

So, If somebody has ever faced this problem I'd like to know which way is better or if there's another way I've not thought about.

Thanks.
GeneralBitwise Operators in SQL Pin
Chris Meech14-Nov-01 6:09
Chris Meech14-Nov-01 6:09 
QuestionIs there an equivalent of the case construct in tSql? Pin
Jason Jystad7-Nov-01 11:32
Jason Jystad7-Nov-01 11:32 
AnswerRe: Is there an equivalent of the case construct in tSql? Pin
AndyG7-Nov-01 18:29
AndyG7-Nov-01 18:29 
GeneralRe: Is there an equivalent of the case construct in tSql? Pin
Jason Jystad8-Nov-01 6:09
Jason Jystad8-Nov-01 6:09 
AnswerRe: Is there an equivalent of the case construct in tSql? Pin
Gerald Schwab8-Nov-01 6:18
Gerald Schwab8-Nov-01 6:18 
AnswerRe: Is there an equivalent of the case construct in tSql? Pin
Carlos Antollini8-Nov-01 7:27
Carlos Antollini8-Nov-01 7:27 
AnswerRe: Is there an equivalent of the case construct in tSql? Pin
Nick Parker30-Nov-01 8:51
protectorNick Parker30-Nov-01 8:51 
QuestionDoes anybody know why ........ ? Pin
5-Nov-01 2:33
suss5-Nov-01 2:33 
AnswerRe: Does anybody know why ........ ? Pin
Rashid Thadha15-Nov-01 3:12
Rashid Thadha15-Nov-01 3:12 
Generalchanging the value of a recordset's property Pin
Yair Konfino4-Nov-01 22:25
Yair Konfino4-Nov-01 22:25 
GeneralRe: changing the value of a recordset's property Pin
chris foote11-Nov-01 11:20
chris foote11-Nov-01 11:20 
GeneralADO GLOBAL CONNECTION Pin
3-Nov-01 10:35
suss3-Nov-01 10:35 
GeneralRe: ADO GLOBAL CONNECTION Pin
31-Jan-02 0:19
suss31-Jan-02 0:19 
GeneralDatabase Design Question Pin
1-Nov-01 6:54
suss1-Nov-01 6:54 
GeneralADO Errors ?!! Pin
Ravish31-Oct-01 2:27
Ravish31-Oct-01 2:27 
QuestionI want a ADO wrap class not using MFC,who can help me? Pin
Jeason Zhao28-Oct-01 22:04
Jeason Zhao28-Oct-01 22:04 
AnswerRe: I want a ADO wrap class not using MFC,who can help me? Pin
Daniel Turini28-Oct-01 22:18
Daniel Turini28-Oct-01 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.