June 27, 2009 at 1:37 am
In my application, there is one Datetime field. While saving if the date field is not selected it stores "1/1/1900 12:00:00 AM" in database. I want to store "NULL" [/i] instead. Please help me resolve this problem.
June 27, 2009 at 2:27 am
Hi,
insert the table value as null,don't pass the value like '',' '
or
put the table column as null
like
CREATE TABLE #TEMP
(
DATE1 DATETIME NOT NULL,
DATE2 DATETIME NULL
)
INSERT INTO #TEMP
SELECT '2008-05-05',NULL
UNION ALL
SELECT '','2008-05-06'
SELECT *FROM #TEMP
ARUN SAS
June 27, 2009 at 3:43 am
Duplicate post. No replies to this thread please. Direct replies to:http://www.sqlservercentral.com/Forums/Topic743086-149-1.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 27, 2009 at 3:53 am
Hi Shaw,
Another topic having the same issue
See the link
http://www.sqlservercentral.com/Forums/Topic743085-149-1.aspx
I will edit the link there.
ARUN SAS
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply