Fuction returns a value whereas procedure doesnt return any
if some function calling is dere den function switch over 2
d function definition part directly but procedure go from
top 2 down linearly
Bot functions and procedures can return values. Apart from
this following are the differences
1) Functions are used for computations where as procedures
can be used for performing business logic
2) Functions MUST return a value, procedures need not be.
3) You can have DML(insert,update, delete) statements in a
function. But, you cannot call such a function in a SQL query..
eg: suppose, if u have a function that is updating a table..
you can't call that function in any sql query.
- select myFunction(field) from sometable; will throw error.
4) Function parameters are always IN, no OUT is possible
5) Function returns 1 value only. procedure can return
multiple values(max. 1024)
6) Stored Procedure :supports deffered name resoultion
Example while writing a stored procedure that uses table
named tabl1 and tabl2 etc..but actually not exists in
database is allowed only in during creation but runtime
throws error Function wont support deffered name resolution.
Stored procedure returns always integer value by default
zero. where as function return type could be
scalar or table or table values(SQL Server).
Stored procedure is pre compiled exuction plan where as
functions are not.
7) A procedure may modifiy an object where a function can
only return a value.
1.Funcan can return a valur but not procedure
2.Function can accept only one parameter IN but procedure
can take IN or OUT or both parameters.
3.Procedure follows only linear execution but not function.
1.In VB Script 100 lines Script. How can check the Syntax
errors? 2. Write a VB Script for X =
India/Srilanka/Australia/England/South Africa.I need the
Output Country wise? [ 1st Msgbox India , 2nd Msgbox
Srilanka] ---- 3. How can Choose these test cases to be