Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

How popular are stored procedures today, compared to 5 years ago?

I ask this question because the book that I'm reading (an ASP.NET 4 book) has no stored procedures in it. Is it the ASP.NET 4 way now?

share|improve this question
4  
Stored Procedures usually refer to DB objects... Why would the author want to open that box? It outside the scope of the book! –  Morons Mar 15 '11 at 19:44
    
I was taught it was the default way to access databases as an ASP.NET Junior back in 2005. –  TeaDrinkingGeek Mar 15 '11 at 19:48
    
@Morons You should add that to your answer. It's a fair point. :) –  Anna Lear Mar 15 '11 at 20:26
    
Done.........10 –  Morons Mar 15 '11 at 20:42
    
What's the book your reading, by the way? –  Carson63000 Mar 15 '11 at 23:03

4 Answers 4

up vote 1 down vote accepted

Stored Procedures usually refer to DB objects... Why would the author want to open that box? It outside the scope of the book!


Read up on SPs...

http://en.wikipedia.org/wiki/Stored_procedure

http://msdn.microsoft.com/en-us/library/aa174792(v=sql.80).aspx

ASP.net Data Access:

http://msdn.microsoft.com/en-us/library/ms178359.aspx

Calling an SP from ASP.net:

http://support.microsoft.com/kb/306574

share|improve this answer

What data access API does your book cover? I would hope that it would be Entity Framework, since that is the Microsoft-endorsed API of the moment.

You can certainly use stored procedures easily through Entity Framework, they basically get mapped as methods on your ObjectContext. If they perform selects you can map the results to either a new class or an existing class; if they just perform updates it's even simpler.

Here's a blog post giving a quick overview: http://blogs.msdn.com/b/bindeshv/archive/2008/11/20/using-stored-procedures-in-entity-framework.aspx

share|improve this answer

The .Net world is seeing an emergance of ORM systems like NHibernate and LINQ to Entities these systems lessen the need for stored procedures in a .net system.

share|improve this answer
    
I will definitely read up on this. Thanks. –  TeaDrinkingGeek Mar 16 '11 at 10:13

I would say, just based on my own opinion and recent experience, that a good many developers are opting for ORM tools that abstract away all of the database code. That can make stored procs less necessary because the ORM framework is doing everything you would do in a stored proc (theoretically).

You'll find a lot of inline SQL vs. stored procs debate on the web. I don't have a strong opinion one way or the other except that inline SQL should always be parameterized rather than spaghetti-coded with a bunch of concatenations.

But stored procs are definitely still very popular and aren't going anywhere.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.