Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mattsmith321
Starting Member
12 Posts |
Posted - 2001-03-20 : 18:13:38
|
| First, let me state that I have read the following articles about paging: http://www.aspfaqs.com/webtech/062899-1.shtml and http://www.15seconds.com/Issue/010308.htmSecond, I have paged with ADO and Stored Procedures so I don't have any basic questions on making that work.So what do I want? With the examples that I have seen regarding paging with stored procedures, they all perform a query, create a temp table with an IDENTITY column (set to start at 1 and then increment by 1), write to the temp table, query the temp table for the rows that are needed by the IDENTITY column, and then the temp table is dropped.Finally, my question: Is there not a way to somehow number the rows in a derived table to eliminate the creation of the temp table? According to this article, http://www.sql-server-performance.com/jg_derived_tables.asp, creating a temp table is much slower than using derived tables.I guess what I'm looking for is something like this:**** RowNum below is the mythical Aggregate Function that I want to number each row in my derived table *****SELECT UserID, UserNameFROM ( SELECT ROWNUM AS RowID, UserID, UserName FROM Users )WHERE (RowID >= @Start)AND (RowID <= @End)Does anyone know of such capability? Thanks,Matt |
|
|
|
|
|
|
|