Is it possible to set NULL value for int column in update statement?
How can I write the update statement in this case?
Is it possible to set NULL value for int column in update statement?
How can I write the update statement in this case?
Assuming the column is set to support NULL as a value:
UPDATE YOUR_TABLE
SET column = NULL
Be aware of the database NULL handling - by default in SQL Server, NULL is an INT. So if the column is a different data type you need to CAST/CONVERT NULL to the proper data type:
UPDATE YOUR_TABLE
SET column = CAST(NULL AS DATETIME)
...assuming column
is a DATETIME data type in the example above.
By using NULL
without any quotes.
UPDATE `tablename` SET `fieldName` = NULL;
Provided that your int column is nullable, you may write:
UPDATE dbo.TableName
SET TableName.IntColumn = NULL
WHERE <condition>
If this is nullable int field then yes.
update TableName
set FiledName = null
where Id = SomeId