Solved

Help

Posted on 1998-12-04
1
236 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

Suggested Solutions

Title # Comments Views Activity
Help in Copy Database Wizard From One SQL Server to Other SQL Server 10 28
SQL Server Deadlocks 12 47
SQL Server - Slabs 9 36
SQL Server Question 5 25
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…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
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.

914 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now