Professional Web Applications Themes

Limiting the result set - Microsoft SQL / MS SQL Server

I have a table with 200000 records. I want the user to search the table but maximum 100 records at a time should be visible. It is easy to get the first 100 by using "Select top 100 ...". But how can I get the next 100? Is there a way to get a range of records from a result set?...

  1. #1

    Default Limiting the result set

    I have a table with 200000 records. I want the user to search the table but
    maximum 100 records at a time should be visible. It is easy to get the first
    100 by using "Select top 100 ...". But how can I get the next 100? Is there
    a way to get a range of records from a result set?



    Mats Guest

  2. #2

    Default Re: Limiting the result set

    There are many articles paging in SQL Server ... Some of them are ...

    How do I page through a recordset?

    http://www.aspfaq.com/show.asp?id=2120

    Article on Paging: Use ADO, getrows, or a Stored Procedure?
    http://www.15seconds.com/Issue/010308.htm

    http://www.4guysfromrolla.com/webtech/062899-1.shtml


    --
    HTH,
    Vinod Kumar
    MCSE, DBA, MCAD
    www.extremeexperts.com


    "Mats Olsson" <se> wrote in message
    news:Ys4_a.22413$.. 
    but 
    first 
    there 


    Vinodk Guest

  3. #3

    Default Re: Limiting the result set

    Mats,
    Suppose you have one column (say an identity column) that increases
    monotonically (it may have holes). Then you can use a WHERE id > something
    clause. Your client will have to give previous id + 100 as the starting
    point.
    A Joshi.

    "Vinodk" <com> wrote in message
    news:#phx.gbl... 
    > but 
    > first 
    > there 
    >
    >[/ref]


    Ajoshi Guest

Similar Threads

  1. Limiting connections to FMS
    By DanielKozimor in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: June 13th, 08:23 PM
  2. Text limiting
    By Wally Kolcz in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: March 30th, 05:07 AM
  3. limiting my query
    By heath_edw in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: March 18th, 11:51 AM
  4. Limiting query result : rownum vs cursor loop
    By Min-Koo in forum Oracle Server
    Replies: 1
    Last Post: October 17th, 09:09 PM
  5. Limiting Old Posts
    By Diggy in forum Windows XP/2000/ME
    Replies: 2
    Last Post: July 19th, 03:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139