Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 5th, 2003, 11:33 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default rownum or something like it

if there is no rownum feature, what is the best way to retrieve the first 5 or 10 records out of a table?

 
Old August 5th, 2003, 11:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As there are no such things as records in SQL (See many of Jeff Mason's posts for explanations ;)) the question is meaningless.
What you are able to do is select the top x rows or columns from a query, but unless you explicitly state an ordering scheme eg
[code]
SELECT Top 10 * FROM aTable ORDER BY ColumnA
[\code]
, you will not be able to rely on having the same records on consecutive runs of the query.

HTH


There are two secrets to success in this world:
1. Never tell everything you know





Similar Threads
Thread Thread Starter Forum Replies Last Post
Rownum in SQLServer Shais SQL Server 2000 2 December 27th, 2007 07:52 AM
Rownum is SQL SERVER rubina SQL Server 2000 3 December 2nd, 2006 10:57 AM
In rownum subhendude SQL Language 0 December 25th, 2005 02:27 AM
rownum field in sql server mateenmohd SQL Server 2000 2 June 12th, 2003 04:48 PM
sql server 2000 rownum mateenmohd Classic ASP Databases 1 June 9th, 2003 03:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.