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 |
|
zekekez
Starting Member
1 Post |
Posted - 2004-08-26 : 18:35:55
|
| if an empty string, '', is assigned to a variable of type int, comparison of the variable to '' or 0 is true.query:declare @x intset @x = ''if @x = '' print 'empty'if @x = 0 print 0result:empty0I haven't come across this before. Is this normal?Zeke |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-08-26 : 18:40:30
|
| declare @x intset @x = ''print @xAssigning @x to '' is actually setting it to 0. See above code. If you don't want it to be set to anything, set it to NULL.Tara |
 |
|
|
|
|
|