Post
by James McCall » 29 Aug 2008, 20:56
Posted by: James McCall
This is quite an old post so you probably have a fix already.
I'm no expert in how SQL Server 2005 implements ANSI NULLs and
concate-null-yields-null. Strange that it should complain about the SET
option in an UPDATE statement. Hopefully it is something you don't even
need to think about - do you even want these behaviours turned on? I'd take
a look at MSDN online to understand what they are (if you don't already
know): http://msdn.microsoft.com/de-de/library/ms179472(SQL.90).aspx
You can change the behaviour of these two settings in your database
properties (open the database properties dialog in SQL Server Management
Studio and choose "Options").
You can also make your program change them at run-time ...
Call SqlPrepareAndExecute( hSql, 'SET ANSI_NULLS off' )
Call SqlPrepareAndExecute( hSql, 'SET CONCAT_NULL_YIELDS_NULL off' )
It might also be an issue that can be solved by changing your database
compatibility level. This is also on the database properties dialog in the
"Options" section. You can make your database behave like an older version
(eg. SQL Server 2000).
James