adspace


diffrence between function and procedure

Answer Posted / jayanth

Functions always returns a value where as sp performs bath execution
functions can be used along with select statement and where clause where as functions cannot be used with update insert delete statements in which sp cannot be used with select and DML events
functions cannot be used with try catch block where as sp can use try catch block
functions are of two types system functions and user defined functions where as sp's are four types mostly
sp with parameters
sp without parameters
sp with out parameters
sp with return values

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we shrink data file in sql server?

1125


How to enter binary string literals in ms sql server?

1243


What are the different SQL Server Versions you have worked on?

1077


If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?

1046


what is the difference between openrowset and openquery?

1193


What is self contained sub query?

1138


How to provide default values to function parameters?

1256


Where can you add custom error messages to sql server?

1209


Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?

1022


How do I find query history in sql server?

1022


Why we use the openxml clause?

1078


How to connect php with different port numbers?

1186


Can you index views?

953


If any stored procedure is encrypted, then can we see its definition in activity monitor?

1069


When should you use an instead of trigger?

1051