I have the following SQL table:
CREATE TABLE [dbo].[Test](
[TestID] [int] NOT NULL,
[TestNum] [int] NULL,
[TestReason] [varchar](50) NULL
)
So TestNum INT , which allows you to use NULL values, and I put a large amount of data into the table, of which some rows contain a NULL value for TestNum
If I then run the following query
select *
from Test
where TestNum != 123
The aboe query does not return null strings . I expect it to return ALL rows, EXCLUDING those that have a value of 123.
Why is this?
I run this query in MS-SQL 2000 DB imported into MS SQL 2005. Does this have any effect? Or is this standard behavior for all versions of MS SQL Server?