Need practical advice on using single stored procedure to process data adapter commands

N

Noel Justus

Im trying to minimize the number of stored procedures and was
wondering if there is any downside to using a single stored procedure
to handle the select,insert,update, and delete commands for a data
adapter.

I create the sql dataadapter using system tables to generate the
parameters and add an additional parameter to denote the type of
process.

Would appreciate any experienced criticisms.....thanks
 
H

Hermit Dave

insert would potentially need all the data.... (would have to generate a
primary key)
update would potentially need some day with the primary key value...
delete would just require the primary key value

now you can write code where you check for nulls and use a bigger stored
procs with if statements trying to process whether the request is
insert update or delete..
but if you have a problem if might be harder to sort out.....

plus y send extra parameters the K.I.S.S. methodology always pays with good
performance... you have to write lot more code but it performs better and
can be debugged in a better way.

HTH
 
K

Kathleen Dollard

Noel,

If you're just trying to reduce the code you write, you might want to look
into generating your stored procedures.

Is there anything else you want to gain by "minimizing the number of stored
procs"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top