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. See If Stored Proc Returns Data

See If Stored Proc Returns Data

Scheduled Pinned Locked Moved Database
databasequestionannouncement
5 Posts 5 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.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?

    Everything makes sense in someone's mind

    M L C V 4 Replies Last reply
    0
    • K Kevin Marois

      I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?

      Everything makes sense in someone's mind

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Kevin Marois wrote:

      Can SQL tell me the result of the query

      Not without executing the code.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      • K Kevin Marois

        I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?

        Everything makes sense in someone's mind

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        You can get the body-text of the sproc, and see if it contains a "RETURN" statement. That does not mean that the sproc actually returns something, that will depend on the logic. Return types will be defined for functions, not for sprocs.

        Bastard Programmer from Hell :suss:

        1 Reply Last reply
        0
        • K Kevin Marois

          I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?

          Everything makes sense in someone's mind

          C Offline
          C Offline
          Corporal Agarn
          wrote on last edited by
          #4

          You would have to go into each procedure as you can return data with a select statement, thus looking for just return will not work.

          1 Reply Last reply
          0
          • K Kevin Marois

            I need to check hundreds of sprocs to see if they return data. So, I need to know if the proc [] Returns a dataset [] Returns a scalar [] Runs some other type of command (INSERT, UPDATE, DELETE) Is it possble to determine this in SQL? Can SQL tell me the result of the query?

            Everything makes sense in someone's mind

            V Offline
            V Offline
            vvashishta
            wrote on last edited by
            #5

            Create Params passed to a Store Proc.. as local variables in Debug Code,,, and to check whether a SP returns data, execute the SP with those local variable with specified values.. by marking comment on Create or Alter Command on SP

            - Happy Coding - Vishal Vashishta

            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