Hi,
Am writing an update statement to one of my SQL tables. I have fields which are <NULL> I want them to remain so after the update. When I update they either become blank or Null.
How can I keep them <NULL>.
Any help would be appreciated.
Printable View
Hi,
Am writing an update statement to one of my SQL tables. I have fields which are <NULL> I want them to remain so after the update. When I update they either become blank or Null.
How can I keep them <NULL>.
Any help would be appreciated.
Shouldn't be happening
Show us your SQL statement
If (AccountName = "") Then
SqlComm.CommandText = "UPDATE Accounts SET " + _
" Name = " + DBNull.Value + " WHERE AccountKey = " + AccountKey.ToString()
End IF
The above SQL statement inserts blank into the column.
Do it in SQL.
syntax might be different for different databases but it works fine for me on MS SQL ServerCode:"UPDATE accounts SET name = NULL where accountkey = " + accountkey.tostring()
Thanks a lot... :wave: