Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
olibara
Yak Posting Veteran
94 Posts |
Posted - 2011-03-03 : 01:38:54
|
| HelloI've a good experience in general programming C#, C++, VB,, etcBut I'm totaly newbee for stored procedureI can already create a simple select SP with parameterBut I don't know anything else about the subtility of SP languageWhere can I found a little tutorial about SP syntaxBTW : what is the difference between SP and Functions ?Thanks for your help |
|
|
Ranjit.ileni
Posting Yak Master
183 Posts |
Posted - 2011-03-03 : 01:54:06
|
| Hi,you can find an useful article on SQL Server Stored Procedurehttp://www.mssqltips.com/tutorial.asp?id=160and Here is the some Difference between Stored Procedure and User Defined Functions:Procedure can return zero or n values whereas function can return one value which is mandatory.Procedures can have input,output parameters for it whereas functions can have only input parameters.Procedure allow select as well as DML statement in it whereas function allow only select statement in it.Functions can be called from procedure whereas procedures cannot be called from function.Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.We can go for transaction management in procedure whereas we can't go in function.Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.We can call the functions in SQL statements (select max(sal) from emp). We cannot call Stored Procedures in SQL Statements. --Ranjit |
 |
|
|
olibara
Yak Posting Veteran
94 Posts |
Posted - 2011-03-03 : 02:47:04
|
| Thank you Ranjit.ileniIt help but i didnt found in this little tutorial any syntax example for conditionnal statement, loop, etc..Is there some ?Thanks |
 |
|
|
|
|
|