I just started using Linq to SQL, and it just occurred to me that I don’t really need any sprocs in the database since i can do all the data access through Linq to SQL.
Is there any reason to write sprocs with Linq to SQL?
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There typically is no good reason to write stored procedures in new applications.
The reason is there are myriads of much better techniques for performing data access in your applications. There are numerous object-relational mapping technologies available for dozens of languages and platforms.
One argument for stored procedures is that they present an abstract API in front of the database. The problem with that is, SQL is a very bad language for trying to write high-level business programs. Another problem with that is, you will be consuming the API in front the database from languages other than SQL. Languages like C#, Ruby and Haskell offer far more powerful ways of creating APIs in front of the database, which are much more natural when consumed in these languages.