Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

is it possible to execute sql server function like stored procedure?

please tell me solution.

user-image
Question ajoutée par VISHWANATH TALEKAR , .net Developer , Kale Enterprises Payroll:-[Delivered to Forbes Technosys ltd]
Date de publication: 2013/09/21
taimoor aziz
par taimoor aziz , Senior Developer , Themovechannel

plz elaborate you problem..I think if you know the differnece between sp n function may be it will solve your problem..so kindly read some diifferneces below than think..

  • 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 allows select as well as DML statement in it whereas function allows 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.
  • UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
  • UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
  • Inline UDF's can be though of as views that take parameters and can be used in JOINs and other Rowsetoperations.

ref:http://www.codeproject.com/Tips/286539/Difference-between-stored-procedure-and-function

Mohammad Qusai AL Sabbagh
par Mohammad Qusai AL Sabbagh , Senior SQL Server DBA, Consultant, & Corporate Trainer , Sitespower institute

You can simply create a stored procedure that calls your function, and whenever you want to execute that function, simply call this procedure ;)

More Questions Like This