dbTalk Databases Forums  

default value for a field of type smalldatetime

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss default value for a field of type smalldatetime in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
desperate
 
Posts: n/a

Default default value for a field of type smalldatetime - 02-05-2004 , 10:49 AM






I want to insert a default value in a date field, if the
value in the input text file is blank.

I tried, <null>, null, 1 space, 00/00/00, 99/99/99, and
none of them work (gets cast or datatype error). 1/1/1900
works but I wanted to insert a blank value.

Please Help!!

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: default value for a field of type smalldatetime - 02-05-2004 , 01:43 PM






what about

ISNULL(NULLIF(colName,""),'19990101')



--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"desperate" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I want to insert a default value in a date field, if the
value in the input text file is blank.

I tried, <null>, null, 1 space, 00/00/00, 99/99/99, and
none of them work (gets cast or datatype error). 1/1/1900
works but I wanted to insert a blank value.

Please Help!!



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.