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. function vs stored procedure in sqlserver 2000

function vs stored procedure in sqlserver 2000

Scheduled Pinned Locked Moved Database
questionsharepointdatabasevisual-studio
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.
  • Y Offline
    Y Offline
    yazan_zahi
    wrote on last edited by
    #1

    when we use function ? when we use stored procedure ? how can i defin a function (syntax)? Witch better to use function or sp ? can you be fast pls ??? thank you ?

    S S S 3 Replies Last reply
    0
    • Y yazan_zahi

      when we use function ? when we use stored procedure ? how can i defin a function (syntax)? Witch better to use function or sp ? can you be fast pls ??? thank you ?

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi, as far as I know, function returns a single value as result. Stored procedures are used to compute something without any direct result. For example filling a table with statistical data can be done perfectly with a sp. Functions are better when you want to compute a single value, for example the gross versus net sum. Hope this helps a bit, regards Sebastian P.S: For definition of a function use google, I think it will point you in the right direction.

      1 Reply Last reply
      0
      • Y yazan_zahi

        when we use function ? when we use stored procedure ? how can i defin a function (syntax)? Witch better to use function or sp ? can you be fast pls ??? thank you ?

        S Offline
        S Offline
        saqib82
        wrote on last edited by
        #3

        you can not execute a t-sql query in a function but in stored procedure you can.

        1 Reply Last reply
        0
        • Y yazan_zahi

          when we use function ? when we use stored procedure ? how can i defin a function (syntax)? Witch better to use function or sp ? can you be fast pls ??? thank you ?

          S Offline
          S Offline
          Sumitjh82
          wrote on last edited by
          #4

          functions return only one value.........sp can used to return more than one value.... function need to be complied each time u use....but sp ones complied u can use it...till if cant change any thing:)

          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