Differences between functions and stored procedures?

Answer Posted / paras

UDF
1. Must return a value – a single result set
2. Directly used in select, order by,where, from
3. UDF can’t use nondeterministic function Such as
getdate(), rand()
4. Can’t change server enviroment variables
5. Stops execution of T-SQL code when error occurs
6. Can’t use temp table in UDF

Stored Procedure
1. Can return value – multiple result set
2. Can’t use in select
3. Can use nondeterministic functions
4. Can change server enviroment variables
5. Stored procedure move to the next instruction if you used
proper error handling,
6. Can use temp table in SP

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to manipulate data from one table to another table ?

537


What Are the Main Features of SQL Azure?

93


What does the on delete cascade option do?

536


Where can you find the error log information? : sql server database administration

555


What are pages and extents? : SQL Server Architecture

545






Are semicolons required at the end of sql statements in sql server 2005?

555


How to get nth highest salary from employee table.

609


How can we delete a table in sql server?

542


What is model database? : SQL Server Architecture

557


What does COMMIT command do?

616


How can I create a report based on a query? : sql server management studio

550


Explain what you mean by 3 tier architecture.

615


Difference between group by clause and having clause in SQL?

558


Why Master database is required?

590


last function used in MS Access to convert sql what function will use in sql

1596