SQL Database Concepts Question:
Download Questions PDF

Do you know what is difference between stored procedure and user defined function?

Answer:

It is not possible to change the table data with the use of User defined functions but you can do it by using stored procedure.
The execution of User defined function will be stopped if any error occurred in it. But in the case of Stored procedure when an error occurs the execution will ignore the error and jumps to the next statement.
We can use User defined function in XML FOR clause but we can use stored procedure in XML FOR clause.
It is not possible to make permanent changes to server environment whereas stored procedure can change some of the server environment.
User defined functions do not return output parameters while stored procedure can return output parameters.

Download Basic SQL Server Interview Questions And Answers PDF

Previous QuestionNext Question
Explain what are the restrictions while creating batches in SQL Server?Please explain GO Command in SQL Server?