SQL Server 2000 queries n to M records?
(1) Select top M * From tablename where id not in (select Top n id from tablename) (2 ). Select top M * Temporary table (or table variable) from tablename order by columnname -- insert top M pen Set rowcount n Select * from Table variable order by columnname DESC (3 ). Select Top N * from (Select top M * From tablename order by columnname) Order by columnname DESC (4) If there are no other identity columns in tablename, then: Select Identity (INT) id0, * into # temp from tablename N to M statements: Select * from # temp where id0> = N and id0 <= m If you report an error when executing the Select Identity (INT) id0, * into # temp from tablename statement, this is because the select into/bulkcopy attribute in the middle of your DB is not enabled and must be executed first: Exec sp_dboption Your DB name, 'select into/bulkcopy', true (5). If the table contains the identity attribute, it is simple: Select * From tablename where identity Col between N and m