Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi There are many records in a field of table. I want to set contains of field to null only for some records.
For example :

Update mytable
Set myfields = null
Where myfields = ‘a’

But the second line “Set myfields = null” is not correct.

How can I solve it?


Thanks very much
Posted

1 solution

I tried it with my SQL table, and it worked fine:
SQL
UPDATE MyTable SET myColumn = null WHERE Id = 3
So assuming that your column can contain null values, your code should work fine.

So what are you doing that is different from me?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900