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. Stored procedure question

Stored procedure question

Scheduled Pinned Locked Moved Database
questiondatabase
4 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.
  • L Offline
    L Offline
    LasVegasGuy
    wrote on last edited by
    #1

    How do you write a stored procedure/function that returns recordsets? Thanks Man Learns from History that he never learns from History

    B M H 3 Replies Last reply
    0
    • L LasVegasGuy

      How do you write a stored procedure/function that returns recordsets? Thanks Man Learns from History that he never learns from History

      B Offline
      B Offline
      Bill Dean
      wrote on last edited by
      #2

      in sql? Just have the last statement of the sproc be a select that returns the "table" of data you want.

      1 Reply Last reply
      0
      • L LasVegasGuy

        How do you write a stored procedure/function that returns recordsets? Thanks Man Learns from History that he never learns from History

        M Offline
        M Offline
        Mazdak
        wrote on last edited by
        #3

        Simply , when you write a query there it return recordsets,for example: SELECT * FROM table1 when you put it in a SP it will return all recorsets from that table. Mazy "Improvisation is the touchstone of wit." - Molière

        1 Reply Last reply
        0
        • L LasVegasGuy

          How do you write a stored procedure/function that returns recordsets? Thanks Man Learns from History that he never learns from History

          H Offline
          H Offline
          Husein
          wrote on last edited by
          #4

          CREATE PROCEDURE MyProcedure AS SELECT * FROM SomeTable I hope this helps. Functions are slightly different. There are three types of functions, those that return scalar value, inline table-valued functions and multi-statement table-valued function. The one that you might want is inline table-valued function CREATE FUNCTION MyFunc RETURNS TABLE AS RETURN (SELECT * FROM SomeTable WHERE SomeColumn = SomeCriteria)

          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