Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Retrieval
Message
From
04/08/1999 08:12:16
 
 
To
03/08/1999 23:17:14
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00249577
Message ID:
00249652
Views:
20
>H! I'm new at using MS SQL and I would like to find out if it is possible to retrieve only the first 10 records of a table regardless of column values.

The easiest way would be to use the TOP clause with a SELECT statement. The problem is that the TOP clause required the use of an ORDER BY. Straight off the top of my head, the only way to pull the first 10 rows in natural order would be to use a CURSOR. BTW, if the table does not have a clustered index, it is possible that SQL Server may physically move rows as updates are made to them.

Do you have control over the structure of the table? Can you add an identity column that could just be used to simulate a record number?

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform