Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. how to capture count of records from stored procedrure

how to capture count of records from stored procedrure

Scheduled Pinned Locked Moved Database
sharepointdatabasehelptutorial
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    attalurisubbu
    wrote on last edited by
    #1

    Hi, I want only count of a records returning by a particular stored procedure.. Im trying like this..but not coming.. DECLARE @COUNT INT SET @COUNT = EXEC 'SP NAME' SELECT @COUNT please help me.. bala

    I P N 3 Replies Last reply
    0
    • A attalurisubbu

      Hi, I want only count of a records returning by a particular stored procedure.. Im trying like this..but not coming.. DECLARE @COUNT INT SET @COUNT = EXEC 'SP NAME' SELECT @COUNT please help me.. bala

      I Offline
      I Offline
      Illegal Operation
      wrote on last edited by
      #2

      SELECT COUNT(*) FROM TABLE WHERE Variable = @Variable. Hope it helps.

      Illegal Operation Making Computer Software Talk

      A 1 Reply Last reply
      0
      • A attalurisubbu

        Hi, I want only count of a records returning by a particular stored procedure.. Im trying like this..but not coming.. DECLARE @COUNT INT SET @COUNT = EXEC 'SP NAME' SELECT @COUNT please help me.. bala

        P Offline
        P Offline
        pmarfleet
        wrote on last edited by
        #3

        @@ROWCOUNT will return the no. of rows affected by the last operation in the current session.

        Paul Marfleet

        A 1 Reply Last reply
        0
        • I Illegal Operation

          SELECT COUNT(*) FROM TABLE WHERE Variable = @Variable. Hope it helps.

          Illegal Operation Making Computer Software Talk

          A Offline
          A Offline
          attalurisubbu
          wrote on last edited by
          #4

          hi, thanx for ur reply.. but i want count of (number only) records returing by a particular stored procedure..not table records count.. bye

          1 Reply Last reply
          0
          • P pmarfleet

            @@ROWCOUNT will return the no. of rows affected by the last operation in the current session.

            Paul Marfleet

            A Offline
            A Offline
            attalurisubbu
            wrote on last edited by
            #5

            hi paul, thanx for ur reply.. but in this scenario rowcount will not work.. im trying like this DECLARE @COUNT INT SET @COUNT = EXEC 'SP NAME' SELECT @COUNT can we capture only count of records returning by stored procedures like this??

            P 1 Reply Last reply
            0
            • A attalurisubbu

              hi paul, thanx for ur reply.. but in this scenario rowcount will not work.. im trying like this DECLARE @COUNT INT SET @COUNT = EXEC 'SP NAME' SELECT @COUNT can we capture only count of records returning by stored procedures like this??

              P Offline
              P Offline
              pmarfleet
              wrote on last edited by
              #6

              Works OK when I try it...

              Paul Marfleet

              1 Reply Last reply
              0
              • A attalurisubbu

                Hi, I want only count of a records returning by a particular stored procedure.. Im trying like this..but not coming.. DECLARE @COUNT INT SET @COUNT = EXEC 'SP NAME' SELECT @COUNT please help me.. bala

                N Offline
                N Offline
                neeraj_indianic
                wrote on last edited by
                #7

                You can use @@ROWCOUNT in your stored procedure and take the value returned by @@ROWCOUNT as output parameter of stored procedure.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups