I have a simple job which loads data from sequential file to SQL Server. For this, I am using a sequential file stage and SQL Server stage respectively. The mapping is 1:1. I am reading all the fields as Varchar, but loading the data as per the requirement. The problem is when I am loading a NULL value to a field which is of datetime type, I am getting a fatal error 'Invalid Julian day'.
I have searched this forum and everybody says NULL can be inserted to a date field as long as it is defined as null. I defined my field as null only. Then I added a Transformer stage in between and tried to load a default value like below
Code: Select all
NullToValue(DSLink3.DATSL,'1989-01-02')
Code: Select all
OConv(IConv(NullToValue(DSLink3.DATSL,'1989-01-02'), 'D-YMD[4,2,2]'), 'D-YMD[4,2,2]') : ' 00:00:00'
Now, I would like to know
1) How to insert a NULL date value in to a SQL Server date field?
2) Why the above conversion didn't parse?
Thanks all for your valuable comments to this.