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
Can we write ddl in trigger?
What is a join in sql?
what is the primary use of the model database? : Sql server administration
How to transfer a table from one schema to another?
What are secondary xml indexes?
Why functions are used in sql server?
How global temporary tables are represented and its scope?
What is intellisense?
what is database replicaion? : Sql server database administration
In which sql server version report builder introduced?
Which Model uses the SET concept
Please explain go command in sql server?
Is mysql better than sql server?
Explain the disadvantages of cursors?
What is triggers and its types?