Re: Views vs Stored Procedures, whats the difference?
- From: "--CELKO--" <jcelko212@xxxxxxxxxxxxx>
- Date: 3 Feb 2006 18:06:15 -0800
Personally, I hate views. I can't control what the thing does, and sometimes the optimizer doesn't do what is best. <<
How does the smart money bet?
responsibilities. <<With a stored procedure, I have more options. With the more options, I do have more
Myself, i do not want to have to control 100+ factors that can change
the next time I use the procedure. But T-SQL is a simple one-pass
compiler -- it does nto not re-arrange my if-the-else logic or optimize
my loops.
For sure I would agree to learn views first. It teaches data set mentality. <<
Yes. And that is why a newbie likes it better than a VIEW. Suddenly,
you have to change your mindset, how to use DCL and WITH CHECK OPTIONs
A couple of dissentions. Within the stored procedure will be the exact same code as is in the view, if you do the basics. The optimizer can optimize that SQL code just like it can in the view.<<
Not really. Procedure programmer will tend to use if-then-else while a
VIEW programmer would tend to use CASE expressions. Procedure
programmer will tend to use temp tables as scratch files while a VIEW
programmer would tend to use CTE and derived tables in the query.
Stored procedures can be used to create data sets, and are MUCH more flexible in their capabilities then views. <<
Only because they can take parameters. The two things serve different
purposes
.
- Follow-Ups:
- Re: Views vs Stored Procedures, whats the difference?
- From: Tony Rogerson
- Re: Views vs Stored Procedures, whats the difference?
- Prev by Date: Re: Monthly date range substitution
- Next by Date: Re: Cant seem to find IUSR_MachineName in users using SQLEXPRESS 2005
- Previous by thread: can you tell me why this causes a deadlock?
- Next by thread: Re: Views vs Stored Procedures, whats the difference?
- Index(es):
Relevant Pages
|