Set a field to NULL

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
 
R

Ryan Langton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top