What are the differences between user defined functions and stored procedures?



What are the differences between user defined functions and stored procedures?..

Answer / Vijendra Pratap Singh

User-defined functions (UDFs) are reusable pieces of T-SQL code that return a single scalar value, whereas stored procedures execute a set of commands but don't return a value. UDFs can be used within SELECT, WHERE, and ORDER BY clauses, while stored procedures can handle complex business logic and transactions.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Is sql server difficult to learn?

1 Answers  


How can we determine what objects a user-defined function depends upon?

1 Answers  


List the ways in which dynamic sql can be executed?

0 Answers  


What is database replication? What are the different types of replication you can set up in sql server?

1 Answers  


Explain an incremental backup?

1 Answers  


in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it

1 Answers  


Indexes are updated automatically is the full-text index also updated automatically?

1 Answers  


Explain some DBCC commands?

6 Answers  


Explain the architecture of SQL Server?

2 Answers   ABC, HP, Oracle,


here id col have primary key and identity id name 1 a 2 b 3 c 4 d delete 2nd row then o/p will be id name 1 a 3 c 4 d next inssert 2nd row and i want o/p will be id name 1 a 2 e 3 c 4 d

7 Answers   IBM, TCS,


How to select some specific columns from a table in a query in ms sql server?

1 Answers  


how insert selected column only ?

3 Answers   Robert Half,


Categories