Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2008
    Posts
    16

    Unanswered: Trying Paging by MS-SQL Query

    Hi Experts,

    I am using Swing and MS-SQL in my project.

    I am using following query for fetching some data :-

    SELECT [CRVMReq].[ReqId],[CRVMReq].[ClientReq],[CRVMReq].[ResumeSample] as RS,
    [CRVMReq].[Priority], [CRVMReq].[Subject],[CRVMReq].[ByPass],
    [CRVMReq].[ConsultantNames] as [ConsultantNamesAll],[CRVMReq].[Rec1],[CRVMReq].[Rec2],
    [CRVMReq].[Note] FROM CRVMReq
    WHERE ReqStatusPool NOT like 'FOCUS' and ReqStatus like 'OPEN' and ReadyTD='YES' order by Date desc

    Suppose if this query fetches:-87 records,then I want only 10 record per page.
    I tried to update this query by rownum but couldn't able to do that.

    Please help me out.

    Thanks.

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,845
    Provided Answers: 16
    What version of SQL Server are you using?

  3. #3
    Join Date
    Nov 2008
    Posts
    16
    SQL Server Management Studio Express (2)

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,472
    Provided Answers: 10
    try here

    http://www.asp101.com/samples/db_paging.asp

    I have used this code a number of time in a web page.
    hope this help

    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
    DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
    THEY'RE BEHIND YOU FOR A REASON

Posting Permissions

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