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

Database

 
AnswerRe: Muiltiple SQL Join tutorials Pin
albCode15-Mar-06 2:38
albCode15-Mar-06 2:38 
GeneralRe: Muiltiple SQL Join tutorials Pin
Chandana Subasinghe15-Mar-06 5:48
Chandana Subasinghe15-Mar-06 5:48 
AnswerRe: Muiltiple SQL Join tutorials Pin
HimaBindu Vejella15-Mar-06 19:13
HimaBindu Vejella15-Mar-06 19:13 
QuestionHow to backup data from Online WebServer to My local Server Pin
Rajkamal_dfine14-Mar-06 21:17
Rajkamal_dfine14-Mar-06 21:17 
QuestionNeed help with stored procedure in where clause. Pin
Slow Learner14-Mar-06 9:17
Slow Learner14-Mar-06 9:17 
AnswerRe: Need help with stored procedure in where clause. Pin
Michael Potter14-Mar-06 9:32
Michael Potter14-Mar-06 9:32 
GeneralRe: Need help with stored procedure in where clause. Pin
Slow Learner14-Mar-06 11:34
Slow Learner14-Mar-06 11:34 
GeneralRe: Need help with stored procedure in where clause. Pin
Michael Potter15-Mar-06 3:21
Michael Potter15-Mar-06 3:21 
Yes, that certainly works and saves alot of typing.

In either case, the best 'optimized' version would be 3 separate stored procs. Since the SQL Server optimizes a SP by its first execution (ignoring later re-optimizations due to structure changes), one side of the IF statement will be ignored. In your case, one side is an index lookup and the other is a table scan. It may be best to put each side into its own stored proc and put the IF in another. This way both are optimized properly for execution.

Of course, this is a useless point if your tables are small.
QuestionRetrieve Value from DetailsView Pin
Armando_Ramirez14-Mar-06 7:41
Armando_Ramirez14-Mar-06 7:41 
QuestionUpdate Dates in SQL Pin
Illegal Operation14-Mar-06 1:10
Illegal Operation14-Mar-06 1:10 
AnswerRe: Update Dates in SQL Pin
albCode14-Mar-06 4:34
albCode14-Mar-06 4:34 
GeneralRe: Update Dates in SQL Pin
Illegal Operation14-Mar-06 17:23
Illegal Operation14-Mar-06 17:23 
AnswerRe: Update Dates in SQL Pin
Chris Meech15-Mar-06 7:02
Chris Meech15-Mar-06 7:02 
QuestionPassing arguments for stored procedures IN Pin
BSRK14-Mar-06 1:01
BSRK14-Mar-06 1:01 
AnswerRe: Passing arguments for stored procedures IN Pin
BSRK14-Mar-06 1:19
BSRK14-Mar-06 1:19 
AnswerRe: Passing arguments for stored procedures IN Pin
Colin Angus Mackay14-Mar-06 1:27
Colin Angus Mackay14-Mar-06 1:27 
AnswerRe: Passing arguments for stored procedures IN Pin
Colin Angus Mackay14-Mar-06 1:29
Colin Angus Mackay14-Mar-06 1:29 
AnswerRe: Passing arguments for stored procedures IN Pin
Eric Dahlvang14-Mar-06 4:45
Eric Dahlvang14-Mar-06 4:45 
GeneralRe: Passing arguments for stored procedures IN Pin
Colin Angus Mackay14-Mar-06 21:44
Colin Angus Mackay14-Mar-06 21:44 
QuestionReturn 0 Pin
Brendan Vogt14-Mar-06 0:44
Brendan Vogt14-Mar-06 0:44 
AnswerRe: Return 0 Pin
Michael Potter14-Mar-06 9:36
Michael Potter14-Mar-06 9:36 
QuestionDB_E_DATAFIELD_OVERFLOW Error Pin
Gupta Suraj14-Mar-06 0:14
Gupta Suraj14-Mar-06 0:14 
AnswerRe: DB_E_DATAFIELD_OVERFLOW Error Pin
Colin Angus Mackay14-Mar-06 1:31
Colin Angus Mackay14-Mar-06 1:31 
GeneralRe: DB_E_DATAFIELD_OVERFLOW Error Pin
Gupta Suraj14-Mar-06 3:07
Gupta Suraj14-Mar-06 3:07 
GeneralRe: DB_E_DATAFIELD_OVERFLOW Error Pin
Gupta Suraj16-Mar-06 6:18
Gupta Suraj16-Mar-06 6:18 

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.