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. hi

hi

Scheduled Pinned Locked Moved Database
databasequestion
4 Posts 3 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.
  • P Offline
    P Offline
    PavanPareta
    wrote on last edited by
    #1

    :omg: can some body let me know what is the main diffrence between SQL function and Store Procedure. :cool:

    Pavan Pareta

    E M 2 Replies Last reply
    0
    • P PavanPareta

      :omg: can some body let me know what is the main diffrence between SQL function and Store Procedure. :cool:

      Pavan Pareta

      E Offline
      E Offline
      ednrgc
      wrote on last edited by
      #2

      1. out params

      1 Reply Last reply
      0
      • P PavanPareta

        :omg: can some body let me know what is the main diffrence between SQL function and Store Procedure. :cool:

        Pavan Pareta

        M Offline
        M Offline
        M H 1 2 3
        wrote on last edited by
        #3

        1.stored procedures allow default values for parameters user defined functions do not. 2.stored procedures allow you to use temp tables user defined functions only allow table variables. 3.you can use table valued user defined functions for normal table functionality such as joins, select *, etc. which can be useful sometimes. 4.both have cached execution plans. In general I would suggest to use procedures when you can and function only when a procedure won't do the job, just because it seems that functions could allow you to kill your performance when used in where clauses on queries with alot of rows, or even if used in select list on queries with alot of rows. Also functions calling functions makes sense to an application developer but doing something like that in your databse functions may be tempting, but imho is a bad idea.

        P 1 Reply Last reply
        0
        • M M H 1 2 3

          1.stored procedures allow default values for parameters user defined functions do not. 2.stored procedures allow you to use temp tables user defined functions only allow table variables. 3.you can use table valued user defined functions for normal table functionality such as joins, select *, etc. which can be useful sometimes. 4.both have cached execution plans. In general I would suggest to use procedures when you can and function only when a procedure won't do the job, just because it seems that functions could allow you to kill your performance when used in where clauses on queries with alot of rows, or even if used in select list on queries with alot of rows. Also functions calling functions makes sense to an application developer but doing something like that in your databse functions may be tempting, but imho is a bad idea.

          P Offline
          P Offline
          PavanPareta
          wrote on last edited by
          #4

          :rose::rose::rose::rose::rose::rose::rose::rose: Thanks M.H.1.2.3, thanks for Solution... :rose::rose::rose::rose::rose::rose::rose::rose:

          Pavan Pareta

          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