Function vs. Stored Procedure in SQL Server

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I ve been learning Functions and Stored Procedure for quite a while but I don t know why and when I should use a function or a stored procedure. They look same to me, maybe because I am kinda newbie about that.

Can some one tell me why?

Answers

Functions are computed values and cannot perform permanent environmental changes to SQL Server (i.e. no INSERT or UPDATE statements allowed).

A Function can be used inline in SQL Statements if it returns a scalar value or can be joined upon if it returns a result set.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/1179758/function-vs-stored-procedure-in-sql-server

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils