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 a database in ms sql server?
What is service broker? : sql server database administration
Is it possible to have clustered index on separate drive from original table location?
Mention a few common trace flags used with sql server?
Do you know what are acid properties of transaction?
What is mscorsvw.exe - process - microsoft .net framework ngen?
Explain how you can deploy an SSRS report?
How do I create a partition table in sql server?
What is truncate table?
Can truncate be rolled back?
Why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it?
Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
What are the underflow and overflow behaviors on float literals?
What is data source object?
What is sql server programming?