Solved

Help

Posted on 1998-12-04
1
259 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
1 Comment
 
LVL 3

Accepted Solution

by:
cognition earned 50 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

808 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