Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help

Posted on 1998-12-04
1
Medium Priority
?
278 Views
Last Modified: 2010-03-19
When I select certain post from a table, it can be too many hits, so I want that there are only the first 50 hits shows then you choose Previous 50 or next 50 etc, and also show where you are like (1-50)of 170, How can I do on a nice way?
0
Comment
Question by:ruisun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
cognition earned 100 total points
ID: 1092088
You could use an IDENTITY column and also the SET ROWCOUNT n within a stored procedure.

CREATE PROCEDURE GetPost
@nlastident int,
@nNumberToGet tinyint
AS

SET ROWCOUNT @nNumberToGet

SELECT *
FROM Post
WHERE Post.identitycolumn > @nlastident

SET ROWCOUNT 0

You could also use a datetime column instead of an IDENTITY column.



0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question