views:

176

answers:

1

Is it always good to use stored procedures , is it good for database performance and what kind of queries that you better use stored procedures?


Exact Duplicate: When should you use stored procedures?

A: 

If you just have a select statement without any parameters needing to be passed to it, a view is fine. User-defined-functions are needed if you want to include them inside of a select statement (Ever tried to create a join to a Stored Proc?). Otherwise, if you need to execute update, delete, insert queries or access an object outside of the database (text file?), send email, you really don't have a choice.

Not sure of the difference between the performance of a view and a stored procedure in SQL SERVER.

Jeff O