HighTechTalks DotNet Forums  

About storedprocedure

Dotnet FAQs microsoft.public.dotnet.faqs


Discuss About storedprocedure in the Dotnet FAQs forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
srinivasreddy
 
Posts: n/a

Default About storedprocedure - 10-11-2006 , 12:18 AM






Hi

How can I write one Stored procedure for Multipleoperations like ,
Insert,Update,Ritrive,Delete In a single stored procedure ,


regards
srinicasreddy



Reply With Quote
  #2  
Old   
Scott M.
 
Posts: n/a

Default Re: About storedprocedure - 10-14-2006 , 03:03 PM






I don't think you can.


"srinivasreddy" <srinivask (AT) acuserv (DOT) net> wrote

Quote:
Hi

How can I write one Stored procedure for Multipleoperations like ,
Insert,Update,Ritrive,Delete In a single stored procedure ,


regards
srinicasreddy




Reply With Quote
  #3  
Old   
dc
 
Posts: n/a

Default Re: About storedprocedure - 10-14-2006 , 04:04 PM



"srinivasreddy" <srinivask (AT) acuserv (DOT) net> wrote

Quote:
Hi

How can I write one Stored procedure for Multipleoperations like ,
Insert,Update,Ritrive,Delete In a single stored procedure ,


regards
srinicasreddy

The only way I can think of is to use parameters to decide whether to
insert, update, select or delete.

CREATE StoredProcedure1
(@functype int,
....
)

IF @functype = 0
SELECT....
ELSE
IF @functype = 1
UPDATE...
ELSE
IF @functype = 2
DELETE...
ELSE
INSERT...

HTH




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.