dbTalk Databases Forums  

Check date in DTS

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


Discuss Check date in DTS in the microsoft.public.sqlserver.dts forum.



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

Default Check date in DTS - 08-23-2005 , 06:16 AM






Hi all,

I am trying to import data (about 18,000 rows) from Access 97 to SQL
Server 2000 via DTS. Some of the date are invalid such as 15/6/989 or
21/07/3005 (I can't make any changing in source table). I have written
the below Active X scripts for fitering but there is always have a error
when importing (data over flow):

If IsDate(DTSSource("Project Closed")) then
DTSDestination("Project ID") = DTSSource("Project ID")
DTSDestination("Project Name") = DTSSource("Project Name")
DTSDestination("Project Closed") = DTSSource("Project Closed")
Main = DTSTransact_OK
Elseif Not(IsNull(DTSSource("Project Closed"))) and
Not(IsDate(DTSSource("Project Closed"))) then
DTSDestination("Project ID") = DTSSource("Project ID")
DTSDestination("Project Name") = DTSSource("Project Name")
DTSDestination("Invalid Date") = CStr(DTSSource("Project Closed"))
'would like to convert to string to store the invalid date to the
another column
Main = DTSTransact_OK
Else
Main = DTSTransact_SkipInsert
End if

Can anyone help about this problem. Thanks a lot.

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.