Re: Updating to NULL instead of zero

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Scott Morris (bogus_at_bogus.com)
Date: 03/11/04


Date: Thu, 11 Mar 2004 13:13:20 -0500

A trigger is the only way that I know of to do this. A constraint is used
for checking and cannot modify existing data.

However, if the code is that convoluted, how can you be certain that
changing the expected value of zero to NULL will not adversely impact
something else? Code that implicitly assumes that data is not null often
fails to work correctly when NULL is present. Test thoroughly!

"RobertS" <anonymous@discussions.microsoft.com> wrote in message
news:b65e01c40792$cae8f1a0$a101280a@phx.gbl...
> >Look up NULLIF function in SQL Server Books Online.
> >
> But I don't have access to the UPDATE statement, so I
> can't use any functions. If I did, I would just change the
> 0 to a NULL.



Relevant Pages

  • Re: IDENTITY column
    ... I don't believe a trigger will work for you either Bevo. ... This constraint should be checked ... Is there a reason you can't modify the INSERT statement to something like: ...
    (microsoft.public.sqlserver.server)
  • Re: Updating to NULL instead of zero
    ... Look up a Trigger in the BOL. ... >>Look up NULLIF function in SQL Server Books Online. ...
    (microsoft.public.sqlserver.programming)
  • Re: Updating to NULL instead of zero
    ... instead of trigger should be able to do ... >>Look up NULLIF function in SQL Server Books Online. ...
    (microsoft.public.sqlserver.programming)