Not sure what you mean by "locate-type" screens.But for paging, you can handle it on either side. ASP.NET has some built in controls to handle paging, ex. data lists. If you want to do it on the SQL Server side your going to need to use a stored procedure. Here is a SP that I use to handle paging on the sql server.create PROCEDURE staffList @pageNum int = -1, @pageSize int, @totalHits int OUTPUT, @totalPages int OUTPUT asDECLARE @start int ,@end int ,@err int-- This table holds results of the query and assigns a record number DECLARE @results TABLE ( recnum int IDENTITY(1,1),username char(8), deptName varchar(50), posName varchar(50), fname varchar(50), lname varchar(50), email varchar(50), listed bit, access bit)-- write the results to the table variable so that each row is assigned to a recnumINSERT INTO @results (username, deptName, posName, fname, lname, email, listed, access) SELECT s.username, d.deptName, p.posName, s.fname, s.lname, s.email, s.listed, s.access FROM dbo.staff s inner join dbo.department d on s.deptID = d.deptID inner join dbo.position p on s.posID = p.posID ORDER BY s.lname, s.fnameSELECT @err = @@ERROR, @totalHits = @@ROWCOUNTselect @totalPages = ceiling(cast(@totalHits as decimal)/ cast(@pageSize as decimal))IF @err != 0 RETURN -1-- calculate the beginning and ending row numbersSET @end = @pageNum * @pageSizeSET @start = @end - @pageSize + 1-- Return the requested page unless @pageNum = -1, in which case, return the entire result setSELECT username, deptName, posName, fname, lname, email, listed, accessFROM @resultsWHERE (@pageNum = -1 OR recnum BETWEEN @start AND @end)IF @@ERROR != 0 RETURN -1ELSE RETURN 0
- Eric