Is it possible to set null value back in SQL server 2000?

G

Guest

Hello, everyone

I have a column 'date' is datetime type and allow null value in SQL server 2000
if I insert a recod without set 'date' value that is null, but after I set the date value, such as 1/1/04, then I want to delete the 'date' value again. the system will set the value as 1/1/1900. Is it possible to set it as null again

Thanks for your help

Haiwe
 
W

William Ryan eMVP

Haiwen:

How are you trying to do this? You should be able to use something like
UPDATE myTable
Set DateColumn = NULL
WHERE whatever = @Whatever
haiwen said:
Hello, everyone,

I have a column 'date' is datetime type and allow null value in SQL server 2000.
if I insert a recod without set 'date' value that is null, but after I set
the date value, such as 1/1/04, then I want to delete the 'date' value
again. the system will set the value as 1/1/1900. Is it possible to set it
as null again?
 
D

Derek Slager

I have a column 'date' is datetime type and allow null value in SQL
server 2000. if I insert a recod without set 'date' value that is null,
but after I set the date value, such as 1/1/04, then I want to delete
the 'date' value again. the system will set the value as 1/1/1900. Is it
possible to set it as null again?

Try setting your parameter value to DBNull.Value.

-Derek
 
B

Bernie Yaeger

Hi Haiwen,

Try this:
dateval = dbnull.value

HTH,

Bernie Yaeger

haiwen said:
Hello, everyone,

I have a column 'date' is datetime type and allow null value in SQL server 2000.
if I insert a recod without set 'date' value that is null, but after I set
the date value, such as 1/1/04, then I want to delete the 'date' value
again. the system will set the value as 1/1/1900. Is it possible to set it
as null again?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top