Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
pravin14u
Posting Yak Master
246 Posts |
Posted - 2008-03-13 : 04:07:27
|
| The following is a condition that I need to implementIF @CustomerId = '-1'BEGIN SET @whereClause = @whereClauseENDELSEBEGIN SET @whereClause = @whereClause +' AND (Customer_id =' + '''' + @CustomerId + ''') 'ENDShould I use a case statement here or leave it to IF ELSE... which will give me optimal performance? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-03-13 : 04:10:49
|
IF @CustomerID <> '-1' SET @whereClause = @whereClause +' AND (Customer_id = ' + '''' + @CustomerId + ''') 'will be enough E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|