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 row_number function?
What is the recovery model? List the types of recovery model available in sql server?
Can group functions be used in the order by clause in ms sql server?
Explain the difference between HTTP and HTTPS in database?
How to maintain a fill factor in existing indexes?
What is the use of keyword with encryption. Create a store procedure with encryption?
Tell me the difference between clustered and non-clustered index?
What are the different methods available under sqlcommand class to access the data?
Can you explain different types of locks in sql server?
Explain transaction server explicit transaction?
What is full outer join in sql server joins?
Do you know query execution plan?
How will you optimize a stored procedure optimization?
Explain transaction server isolation?
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration