Avinash
Avinash

Reputation: 61

How to update a column with a "blank" value

How do I update a column value (varchar(20), not null) with a "blank" value?

Upvotes: 6

Views: 85179

Answers (3)

Mitul Panchal
Mitul Panchal

Reputation: 632

If there have any int column which you may want to do null

Update TABLE_NAME set name = '',id = cast(NULLIF(id,'') as NVARCHAR)

Upvotes: 0

Nanda
Nanda

Reputation: 614

Update TableName Set ColumnName='' where [Condtion] // To update column with an enpty values

Upvotes: 6

Louis
Louis

Reputation: 4210

If you want to update it with NULL you will need to change it to allow NULL. Otherwise update with an empty string "".

Upvotes: 8

Related Questions