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 |
influent
Constraint Violating Yak Guru
367 Posts |
Posted - 2007-03-08 : 14:26:22
|
I know how to work around this, but I'm curious about the theory here. The following query does not return what I was expecting. Without the where clause, my db has 100 rows where t2.table_name is not null (2 of which are dtproperties) and 30 rows where it is. So I'd think that adding the where clause would only remove two rows, but it removes 32. It appears that when t-sql compares a varchar to NULL using "not equal" it gets confused. Can anybody explain this to me?SELECT *FROM INFORMATION_SCHEMA.TABLES t1FULL OUTER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE t2ON t1.table_name = t2.table_nameWHERE t2.table_name != 'dtproperties' |
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-03-08 : 15:10:16
|
Take a look here for a full explanation, it's a very important topic, and often misunderstoodhttp://www.sqlservercentral.com/columnists/mcoles/2829.asp |
 |
|
|
|
|