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 |
|
Rita Bhatnagar
Posting Yak Master
172 Posts |
Posted - 2002-03-06 : 11:35:01
|
| Hi,I have a stored procedure where i want to use if else statement.I have kind ofCreate Procedure .....@PrmNumber varchar(200)asBegin If @prmNumber='*' do this Else do thatEndIt was giving me problem so i tried to debug it.when the first condition was true it hit the first 'do this'and it hit the second one too.Why it's doing that?It shouldn't hit the second part.It should come out of the procedure?Any opinion?I tried like this tooIf Begin Do thisEndElseBegin Do thatEndStill the procedure does the same thing.Any help is appreciated. |
|
|
JamesT
Yak Posting Veteran
97 Posts |
Posted - 2002-03-06 : 11:48:08
|
| The following works fine for me. Perhaps you could post the exact code?CREATE Procedure TEMP_TEST@PrmNumber varchar(200)asBeginIf @prmNumber='5' print 'FIVE'Else print 'NOT FIVE'Endexec TEMP_TEST 5 |
 |
|
|
|
|
|