"Lee" <lee_nospam_@artjunky.com> wrote in message
news:ep7t3k$72t$1@forums.macromedia.com...
> So hear I am, 12 years it this career finding out that
"everyone" is using
> this "Stored Procedures" thing and here I am wondering
how it snuck up on
> me; though I was doing pretty good. Unfortunately, I
have found that a yet
> a new can of worms awaits me.
Well, stored procedures are part of the database programming
world. You'd
be hard-pressed to find any in-depth information from the web
design world.
A typical help site for DW users will tell you how to add a
call to a stored
procedure to your page (via the command object). What causes
some confusion
is that a command object can also take normal queries
(INSERT, UPDATE,
DELETE), not just stored procedure calls. The beauty of a
stored procedure
is that it can do a great number of things in a single call
to the database;
for a simple example, you might have a procedure that will
accept a user
name as a parameter, then return data based on the user's
settings and time
of day plus record the fact that the user requested the data,
the time of
the request, number of records returned, etc.
> I will take another look at the W3 areas that you
mentioned.
W3 Schools are more of a reference than a learning site.
First, make sure you know basic queries:
www.sqlcourse.com
www.sqlcourse2.com
After that, the simplest stored procedures simply encapsulate
those queries.
Instead of running an INSERT to add a user, you'd EXEC the
AddUser
procedure, which might be a simple INSERT, or it might do any
number of
other things in the mean time, the scope of which depends
both on your
database's capabilites and your wishes (SQL Server can even
send an e-mail
from inside the stored procedure, encapsulating the commonly
requested
insert-and-email scenario). It also means you can change the
AddUser
procedure's internals without ever touching your web page
(unless you change
the expected parameters, of course).
Hope that helps you get a handle on things. But remember that
DW is a very
small part of the equation here; it can merely help you call
the procedure.
All the internals of the procedure are part of the database
world, and
you'll need to look in appropriate places.