Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Alex Flores
Alex Flores
7,864 Points

Creating SQL stored procedure

I'm working on a web application and I'm making good progress and I thought I was creating a secure website, but then I learned that any complicated SQL queries should really be put in a SQL stored procedure.

Is this true? What else am I missing in regards to the final web application?

1 Answer

Kevin Gates
Kevin Gates
15,053 Points

Stored procedures are great because they are (IMO) functions/methods for a database. They give you greater security, as well as allow this to be used by other apps that call the database. Also, a stored procedures for a complicated call will run faster than Entity Framework, etc.

While this is not a Treehouse Course, I took this PluralSight course on Stored Procedures and it is very good. I've found it to be fun, but also educational. I have a coworker who is very knowledgeable about stored procedures and this course is covering even the "gotchas" that he mentioned. Start here if you want to learn them, at least until Treehouse adds some courses: https://www.pluralsight.com/courses/sql-server-database-programming-stored-procedures