Re: Views vs Stored Procedures, whats the difference?



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?

With a stored procedure, I have more options. With the more options, I do have more
responsibilities. <<

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

.



Relevant Pages

  • Re: Bad habits of GOTO-using programmers
    ... of the specified scope of the PERFORM. ... If I PERFORM a SECTION with several paragraphs in it (provided I don't do ... it is arguable if paragraphs receiving control within that scope, ... that you use the next programmer will have to dertermine whether this ...
    (comp.lang.cobol)
  • Re: The math algorithm behind cutter compensation G codes
    ... >>of a copy of Computer Numerical Control by Warren S. Seams or something ... >CNC systems engineering book. ... IF the programmer needs circular interpolation about ... and NOT something for the control to randomly guess at ...
    (alt.machines.cnc)
  • Re: Java in Browser
    ... Note the "programmer" in the group name. ... What I want is something as simple as dowloading a .exe file, have the installer say "do you want to run this yadda yadda" and zap - all done. ... Next thing they know is that it opens in their browser tab and controls the universe. ... There's a whole slew of devices that would benefit from a uniform control shell ie a browser to package what are now disparate programs. ...
    (comp.lang.java.programmer)
  • Re: $HASP308 message
    ... It's also a productivity issue. ... How can you control batch elapsed on a busy system? ... The theory is that if the programmer even suspects that the job might ... If the elapsed time is>120 minutes (which it ...
    (bit.listserv.ibm-main)
  • Re: Beginner needs help choosing microcontroller platform & software
    ... > with a free C compiler and $40 programmer and tested ... fail your Test 2 if the axes ... You'll have to do one very hard development, one of five, for control on ... for 6 axes of motion, has a multitasking operating system, and (a ...
    (comp.robotics.misc)