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 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2005-03-22 : 06:28:16
|
| I have an if statement in a stored procedure as follows:if @amount=1 and @value=1beginselect @pp=1endI want to add an else @pp=0What's the correct syntax? |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-03-22 : 07:05:42
|
| if @amount=1 and @value=1beginselect @pp=1endELSEbeginselect @pp=0endKristen |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2005-03-22 : 07:34:47
|
| thanks for you help.How would I set variables I declare to be a default of 0DECLARE @isdouble tinyint,@pp int |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-22 : 08:12:46
|
DECLARE @isdouble tinyint,@pp intselect @isdouble = 0, @pp = 0Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|