Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
irfanshirur
Starting Member
21 Posts |
Posted - 2009-06-10 : 07:28:49
|
| HelloIs there any keyword which will accept row range in query ?select top 100 * from Table, will retirve the first 100 records.Like that if i want to retrive 100-200 rows then ?Please can any one help me out for this solution.Thanks in Advance |
|
|
companionz
Yak Posting Veteran
54 Posts |
Posted - 2009-06-10 : 07:43:13
|
| In your data retreival select query include this function too:Row_number() OVER(ORDER BY table_primary_key) AS RowNumberExample:With temp_tableas (select field_name, Row_number() OVER(ORDER BY primary_key) AS RowNumber from table_name)select field_name from temp_tablewhere RowNumber between 100 and 200Try this out..Sourav |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-10 : 07:43:25
|
It's called pagination and it is not handled gracefully in SQL Server.MySQL has the LIMIT keyword, but SQL Server doesn't.There are many examples of pagination here at SQLTeam. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
irfanshirur
Starting Member
21 Posts |
Posted - 2009-06-10 : 07:55:37
|
| Hi GuysThanks a Lotttt i got the output. |
 |
|
|
|
|
|