How do I update a column value (varchar(20), not null
) with a "blank" value?
Asked
Active
Viewed 7.7k times
6

Juan Mellado
- 14,973
- 5
- 47
- 54

Avinash
- 61
- 1
- 1
- 2
-
3tried what and which database? – d-live May 14 '11 at 04:56
-
[how-to-empty-a-column-in-mysql](http://dba.stackexchange.com/questions/54111/how-to-empty-a-column-in-mysql) – here Dec 17 '15 at 20:37
3 Answers
8
If you want to update it with NULL
you will need to change it to allow NULL
. Otherwise update with an empty string ""
.

Louis
- 4,172
- 4
- 45
- 62
6
Update TableName Set ColumnName='' where [Condtion] // To update column with an enpty values

Nanda
- 604
- 8
- 20
0
If there have any int column which you may want to do null
Update TABLE_NAME set name = '',id = cast(NULLIF(id,'') as NVARCHAR)

Mitul Panchal
- 592
- 5
- 7
-
from [this answer](https://stackoverflow.com/a/6054382/1358091), null is int by default so you don't need to cast – Marco Carletti Mar 19 '21 at 09:52