Click here to Skip to main content
15,922,894 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL HELP Pin
Michael Potter21-Apr-08 8:21
Michael Potter21-Apr-08 8:21 
GeneralRe: SQL HELP Pin
n1coltsfan21-Apr-08 8:36
n1coltsfan21-Apr-08 8:36 
GeneralRe: SQL HELP Pin
Michael Potter21-Apr-08 8:56
Michael Potter21-Apr-08 8:56 
GeneralRe: SQL HELP [modified] Pin
Blue_Boy21-Apr-08 9:17
Blue_Boy21-Apr-08 9:17 
GeneralRe: SQL HELP Pin
n1coltsfan22-Apr-08 8:44
n1coltsfan22-Apr-08 8:44 
QuestionHow to write the multiple query in single store procedure? [modified] Pin
bruze21-Apr-08 1:11
bruze21-Apr-08 1:11 
AnswerRe: How to write the multiple query in single store procedure. Pin
Colin Angus Mackay21-Apr-08 1:22
Colin Angus Mackay21-Apr-08 1:22 
AnswerRe: How to write the multiple query in single store procedure? Pin
Ashfield21-Apr-08 4:30
Ashfield21-Apr-08 4:30 
You can do something like:

Create Proc up_Maintain (@mode char(1))<br />
if @mode = 'a'<br />
begin<br />
    ....code to add<br />
    return<br />
end<br />
if @code = 'd'<br />
begin<br />
    ....code to delete<br />
    return<br />
end<br />
begin<br />
    ....code to update<br />
    return<br />
end


However this is bad practice as the optimiser will optimise for the first time the proc is run. An accepatable alternative is to have a proc like this, but keep the add/delete/update procs and just call thme from the controlling proc, but you gain nothing.

As far as I can see there is nothing to be gained from merging the procs together, but there are potential performance issues, so they should be kept independantly.

Hope this helps

Bob
Ashfield Consultants Ltd

GeneralRe: How to write the multiple query in single store procedure? Pin
bruze21-Apr-08 5:35
bruze21-Apr-08 5:35 
GeneralRe: How to write the multiple query in single store procedure? Pin
bruze21-Apr-08 5:38
bruze21-Apr-08 5:38 
GeneralRe: How to write the multiple query in single store procedure? Pin
bruze21-Apr-08 5:54
bruze21-Apr-08 5:54 
GeneralRe: How to write the multiple query in single store procedure? Pin
Ashfield21-Apr-08 19:52
Ashfield21-Apr-08 19:52 
GeneralGet all tables in sql server instance Pin
hdv21221-Apr-08 0:12
hdv21221-Apr-08 0:12 
GeneralRe: Get all tables in sql server instance Pin
Blue_Boy21-Apr-08 0:33
Blue_Boy21-Apr-08 0:33 
GeneralSSIS issue dynamic table structure Pin
Mycroft Holmes20-Apr-08 21:29
professionalMycroft Holmes20-Apr-08 21:29 
QuestionHow to design Table Pin
jason_mf20-Apr-08 19:34
jason_mf20-Apr-08 19:34 
Questionsqsh clear screen? Pin
devvvy20-Apr-08 17:57
devvvy20-Apr-08 17:57 
QuestionT-SQl (VS) VB Languages Pin
Feras Mazen Taleb19-Apr-08 19:22
Feras Mazen Taleb19-Apr-08 19:22 
GeneralRe: T-SQl (VS) VB Languages Pin
SimulationofSai20-Apr-08 5:28
SimulationofSai20-Apr-08 5:28 
GeneralRe: T-SQl (VS) VB Languages Pin
Christian Graus20-Apr-08 12:33
protectorChristian Graus20-Apr-08 12:33 
GeneralSQL: BETWEEN Condition by Date Pin
kimo code19-Apr-08 4:53
kimo code19-Apr-08 4:53 
GeneralRe: SQL: BETWEEN Condition by Date Pin
Blue_Boy19-Apr-08 5:09
Blue_Boy19-Apr-08 5:09 
GeneralRe: SQL: BETWEEN Condition by Date Pin
kimo code19-Apr-08 21:25
kimo code19-Apr-08 21:25 
GeneralRe: SQL: BETWEEN Condition by Date [modified] Pin
Blue_Boy19-Apr-08 22:01
Blue_Boy19-Apr-08 22:01 
GeneralRe: SQL: BETWEEN Condition by Date Pin
kimo code20-Apr-08 1:02
kimo code20-Apr-08 1:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.