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-06 : 04:18:34
|
| I am trying to do an if statement in a stored procedure but I am new to this.I have 3 separate fields in my db duplicate,nogood,filteredI want to pull out these fields and if duplicate,nogood, or filteterd =1 then set status=that fieldname otherwise set status=goodcan someone help me with the code I would use? |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-03-06 : 07:02:38
|
| if is a control of flow statement - you need case.select status = case when duplicate = i then 'duplicate' when nogood = 1 then 'nogood' when filtered = 1 then 'filtered' else 'good' endfromtbl==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|