Set a field to NULL

  • Thread starter Thread starter Ryan Langton
  • Start date Start date
R

Ryan Langton

How do I set a field = NULL in an SQL statement? This field is an optional
Foreign Key (allows Nulls), but when I try to "SET UserID = NULL" I get an
error, invalid use of NULL. When I try "SET UserID = ''( - single quotes
with no characters - ) I get a foreign key constraint error (because no
value of 'blank' exists in the other table).

Thanks,
Ryan
 
Nevermind, the problem was that I was testing for IsNull() in my VB code
when I should have been testing (value <> ""), then sending (SET value =
null) in my SQL.
 
Back
Top