SQL Stored Procedure

SANCHIT SHARMA

Active member
Joined
Jul 15, 2005
Messages
38
Programming Experience
10+
Hi friends,,, I am using SQL server and VB.net 2005 as frontend.. Sending data in form of Parameters and executing the stored procedure at backend.
While saving I use 3 seperate Application SQL Stored procedure to save the contents of a grid

PR_insert
PR_update
PR_delete

My question is , thet instead of 3 stored procedures I want to write One procedure to handle all DML actions on a specific table..


PLS HELP
 
That is possible, but not in the IDE's wizard to generate them for you..

Also, how will your SP know the difference between the actions? i.e. how will it know to delete? Once I know this I can tell you how to write it.
 
Create one integer e.g (i) variable in Sp apart from u r Table field variable
assign Values for i
ie
if i = 1
Insert cmd
if i=2
update cmd
if i=3
delete cmd
 
Back
Top