Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 185581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:29:43+00:00 2026-05-11T15:29:43+00:00

Would someone please help me. I have a stored procedure (see below) for data

  • 0

Would someone please help me.

I have a stored procedure (see below) for data paging in SQL Server 2005. The purpose of the stored procedure is to return a page of Products (prodid, description) for a particular Category (CatID).

When I execute the stored procedure:

EXEC @return_value = [dbo].[ecosys_CNET_GetCategoryProducts]   @CatID = N'AA',   @PageNumber = 1,   @ProductsPerPage = 10,   @HowManyProducts = @HowManyProducts OUTPUT  

it only returns one (1) row even though there are many Products:

@HowManyProducts: 10034 

I have a similar stored procedure which works just fine for smaller datasets. Am I hitting some sort of limit?

set ANSI_NULLS ON   set QUOTED_IDENTIFIER ON   go    CREATE PROCEDURE [dbo].[ecosys_CNET_GetCategoryProducts]    (   @CatID char(2),   @PageNumber INT,   @ProductsPerPage INT,   @HowManyProducts INT OUTPUT   )    AS    -- Declare a new @Products TABLE variable.   DECLARE @Products TABLE   (   RowNumber INT,   prodid VARCHAR(40),   description VARCHAR(2000)   )    -- Populate the @Product TABLE variable with the selected Products.   INSERT INTO @Products    SELECT    ROW_NUMBER() OVER (ORDER BY cds_atr.prodid),   cds_atr.prodid,   cds_stdnee.description    FROM cds_stdnee    JOIN cds_atr   ON (cds_stdnee.prodid = cds_atr.prodid)    WHERE cds_atr.catid = @CatID    -- Return the Total Number of Products using an OUTPUT variable.   SELECT @HowManyProducts = COUNT(prodid) FROM @Products    -- Extract the Requested Page of Products.   SELECT DISTINCT prodid, description    FROM @Products    WHERE RowNumber > (@PageNumber - 1) * @ProductsPerPage     AND RowNumber <= @PageNumber * @ProductsPerPage 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:29:44+00:00Added an answer on May 11, 2026 at 3:29 pm

    If it’s only returning one row, chances are there is only one row to return. Add a SELECT * FROM @Products and look to see what rows were there. In particular, look at the row numbers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 256k
  • Answers 256k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What you've run into is actually really interesting. I started… May 13, 2026 at 10:33 am
  • Editorial Team
    Editorial Team added an answer [UIApplication sharedApplication].delegate.window.backgroundColor = [UIColor myColor]; If there's only 1 window,… May 13, 2026 at 10:33 am
  • Editorial Team
    Editorial Team added an answer Like this: <img width="200" height="150" src="..." alt="My Small Image" /> May 13, 2026 at 10:33 am

Related Questions

I am attempting to create a small application to collect data received from an
I am trying to learn WCF. I have a simple client and server application
Hi i have a simple accordion set up with jQuery with the HTML structure
I am using Carbide (just upgraded to 2.0) to develop an S60 3rd Edition

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.