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
Explain what is the purpose of sql profiler in sql server?
How do database indexes work?
What is data block and how to define data block size?
What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?
How to delete database objects with "drop" statements in ms sql server?
What is user-defined multi-statement table-valued function?
How do I find the sql server version?
optimization techinques
Stored Procedure returns data from multiple tables. How to access it in your ASP.Net code?
what are the steps you will take to improve performance of a poor performing query? : Sql server database administration
Why we use the openxml clause?
What do you understand by a view? What does the with check option clause for a view do?
List out the difference between union and union all in sql server?
What are the key configuration files for sql server reporting services ?
Explain transaction server consistency?