Store Procedures can have arguments and return values just like any other method. Store Procedures can do everything LINQ can do and usually be faster and more efficient. Using Store Procedures for everything might seem ideal but having hundred's of store procedures in a database often becomes unmanageable and difficult to maintain. I recommend using LINQ for simple everyday queries and store procedures for anything more complicated or if you see performance issues.
Using Store Procedures centralizes your SQL code on the database server and makes it easier to maintain your code if the database changes.
No comments:
Post a Comment