What are the differences between stored procedure and
functions in SQL Server 2000?
Answer Posted / bed singh
a. A FUNCTION is always returns a value using the return
statement. A PROCEDURE may return one or more values
through parameters or may not return at all.
b. Functions are normally used for computations where as
procedures are normally used for executing business logic.
c. A Function returns 1 value only. Procedure can return
multiple values (max 1024).
d. Stored procedure returns always integer value by default
zero. Whereas function returns type could be scalar or
table or table values
e. Stored procedure is precompiled execution plan where as
functions are not.
f. A function can call directly by SQL statement like
select func_name from dual while procedure cannot.
g.Stored procedure has the security and reduces the network
traffic and also we can call stored procedure in any no. of
applications at a time.
h. A Function can be used in the SQL Queries while a
procedure cannot be used in SQL queries .that cause a major
difference b/w function and procedures.
Is This Answer Correct ? | 165 Yes | 8 No |
Post New Answer View All Answers
What is b tree index?
What is attribute relationships, why we need it? : sql server analysis services, ssas
What are user-defined functions (udfs) in sql server?
What is the difference between a stored procedure and a user defined function?
Other than truncate statement, which other command can by-pass the trigger on the tables?
what is a join? : Sql server database administration
Do you know clustered and non-clustered index?
What is sleeping status in sql server?
What do you mean by table and field in sql?
What is the most common type of join?
How you can move data or databases between servers and databases in sql server?
How do you delete duplicate rows in sql server?
What is sql server management studio? : sql server management studio
How to assign new column names in a view?
What is scan table/view and seek table/view when its occurs? : sql server database administration