Groups | Blog | Home
all groups > sql server programming > february 2006 >

sql server programming : Setting date to null


Kalen Delaney
2/1/2006 1:46:37 PM

If the column has been defined to allow NULL, you can just set it to NULL:

update myTable
set myDate = NULL

You do not need the FROM clause for UPDATE, unless you are looking up data
in another table.

If the column has not been defined to allow NULL, you will get an error when
you try to set it to NULL.

--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com


[quoted text, click to view]


Tor Inge Rislaa
2/1/2006 10:41:14 PM
Hi I have a data field i a table where I want to set all values to null.
How?

update myTable
set myDate = ?
from myTable

TIRislaa

AddThis Social Bookmark Button