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 |
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2012-05-21 : 20:44:35
|
When I runSelect * from dbo.vwSectionMenuItems where SectionID = '' and MenuType = 'Info' It returns the results that have Section = 0 why is that? Since the where clause has SectionID = '' shouldnt that return only return results with nothing set in SectionID? (Note: SectionID is a tinyint)-- If I get used to envying others...Those things about my self I pride will slowly fade away.-Stellvia |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-05-21 : 20:50:00
|
SectionID is tinyintIn your where clauseSectionID = ''the empty string '' will be converted to integer and it will be 0 KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-05-21 : 20:50:44
|
or is this what you are after ?where SectionID IS NULL and MenuType = 'Info' KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
Posted - 2012-05-21 : 20:55:32
|
quote: Originally posted by khtan SectionID is tinyintIn your where clauseSectionID = ''the empty string '' will be converted to integer and it will be 0 KH[spoiler]Time is always against us[/spoiler]
That makes sense, thanks-- If I get used to envying others...Those things about my self I pride will slowly fade away.-Stellvia |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
Eagle_f90
Constraint Violating Yak Guru
424 Posts |
|
|
|
|
|