Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DDQ Task and update query

Author  Topic 

sardinka
Posting Yak Master

142 Posts

Posted - 2005-07-21 : 08:46:48
I am having difficulty with the update query in DDQ Task.
In my transfer tab I have an activeX with the following code:
IF DTSSource("Col007")=" " or IsNull(DTSSource("Col007")) then
DTSDestination("BirthDate")=""
My Birthdate field is smalldateTime. When I run the task it is not updating that field to be empty. Why?

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2005-07-21 : 17:19:43
You can't set a datetime field to ''; it needs to be set to NULL.
To verify if the bit of code is being run, you can add a MsgBox command inside the IF statement so you can see when it's being run:
IF DTSSource("Col007")=" " or IsNull(DTSSource("Col007")) then
MsgBox "Col007 is empty"
DTSDestination("BirthDate") = NULL
END IF

Go to Top of Page
   

- Advertisement -