Re: Access vs SQL
Trevor Best (nospam@besty.o rg.uk) writes:[color=blue]
> David Portas wrote:[color=green]
>> http://www.aspfaq.com/show.asp?id=2214[/color]
>
> From that site:
><---
> SQL Server handles NULL values differently. Access assumes NULL = NULL,
> so two rows where a column is <NULL> would match a JOIN clause comparing
> the two. By default, SQL Server treats NULLs correctly as UNKNOWN, so
> that, depending on the settings within SQL Server, it cannot state that
> NULL = NULL. If you are trying to determine whether a column contains a
> NULL value, the following query change should be made:
> -- Access:
> [...] WHERE column = NULL
> [...] WHERE column <> NULL
>
> -- SQL Server:
> [...] WHERE column IS NULL
> [...] WHERE column IS NOT NULL
> --->
>
> WTF? Where on Earth did that information come from? That is totally
> incorrect. Access has never treated a null as equal to another null.[/color]
An even funnier thing, is that SQL Server can behave as described for
Access above. These days you need to apply a SET command for this, but
originally, this was default behaviour for SQL Server.
Access I don't know anything about, so I believe anything you say.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se
Books Online for SQL Server SP3 at
Trevor Best (nospam@besty.o rg.uk) writes:[color=blue]
> David Portas wrote:[color=green]
>> http://www.aspfaq.com/show.asp?id=2214[/color]
>
> From that site:
><---
> SQL Server handles NULL values differently. Access assumes NULL = NULL,
> so two rows where a column is <NULL> would match a JOIN clause comparing
> the two. By default, SQL Server treats NULLs correctly as UNKNOWN, so
> that, depending on the settings within SQL Server, it cannot state that
> NULL = NULL. If you are trying to determine whether a column contains a
> NULL value, the following query change should be made:
> -- Access:
> [...] WHERE column = NULL
> [...] WHERE column <> NULL
>
> -- SQL Server:
> [...] WHERE column IS NULL
> [...] WHERE column IS NOT NULL
> --->
>
> WTF? Where on Earth did that information come from? That is totally
> incorrect. Access has never treated a null as equal to another null.[/color]
An even funnier thing, is that SQL Server can behave as described for
Access above. These days you need to apply a SET command for this, but
originally, this was default behaviour for SQL Server.
Access I don't know anything about, so I believe anything you say.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se
Books Online for SQL Server SP3 at
Comment