dbTalk Databases Forums  

Data Overflow - DTS

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


Discuss Data Overflow - DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sim Poay See via SQLMonster.com
 
Posts: n/a

Default Data Overflow - DTS - 03-14-2005 , 07:36 AM






I keep getting the error
The number of failing rows exceeds the maximum specified
Insert error, column 16('DateX', DB_TYPE_DBTIMESTAMP),
status 6: Data overflow. Invalid character value for cast
specification.

I have the following code in my VB script to capture
invalid dates. It is working fine in the test but it's not working when I
load the real data at the DTS. Below is my script that I have modified from
the link of http://www.sqldts.com/default.aspx?6,103,249,0,1


'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()


dim i_Day
dim i_Month
dim i_Year


i_Day = CInt(Left( DTSSource("Need By Date"), 2 ))
i_Month = CInt(Mid( DTSSource("Need By Date") ,4, 2 ))
i_Year = CInt(Right(DTSSource("Need By Date"),4))


DTSDestination("NEED_BY_DATE") = DateSerial( i_Year , i_Month ,i_Day )




Main = DTSTransformStat_OK
End Function

Thanks in advance help.

--
Message posted via http://www.sqlmonster.com

Reply With Quote
  #2  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: Data Overflow - DTS - 03-14-2005 , 08:19 AM






Sim,

What is 'DateX' declared as?

Ilya

"Sim Poay See via SQLMonster.com" <forum (AT) SQLMonster (DOT) com> wrote

Quote:
I keep getting the error
The number of failing rows exceeds the maximum specified
Insert error, column 16('DateX', DB_TYPE_DBTIMESTAMP),
status 6: Data overflow. Invalid character value for cast
specification.

I have the following code in my VB script to capture
invalid dates. It is working fine in the test but it's not working when I
load the real data at the DTS. Below is my script that I have modified
from
the link of http://www.sqldts.com/default.aspx?6,103,249,0,1


'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()


dim i_Day
dim i_Month
dim i_Year


i_Day = CInt(Left( DTSSource("Need By Date"), 2 ))
i_Month = CInt(Mid( DTSSource("Need By Date") ,4, 2 ))
i_Year = CInt(Right(DTSSource("Need By Date"),4))


DTSDestination("NEED_BY_DATE") = DateSerial( i_Year , i_Month ,i_Day )




Main = DTSTransformStat_OK
End Function

Thanks in advance help.

--
Message posted via http://www.sqlmonster.com



Reply With Quote
  #3  
Old   
Darren Green
 
Posts: n/a

Default Re: Data Overflow - DTS - 03-14-2005 , 10:29 AM



Turn on logging for the DataPump. I would say that your real data has some
invalid values, but your test data does not.

You could pre-empt the failure by validating the values you get from the
string manipulation of the source column, and handle this row yourself.

--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Sim Poay See via SQLMonster.com" <forum (AT) SQLMonster (DOT) com> wrote

Quote:
I keep getting the error
The number of failing rows exceeds the maximum specified
Insert error, column 16('DateX', DB_TYPE_DBTIMESTAMP),
status 6: Data overflow. Invalid character value for cast
specification.

I have the following code in my VB script to capture
invalid dates. It is working fine in the test but it's not working when I
load the real data at the DTS. Below is my script that I have modified
from
the link of http://www.sqldts.com/default.aspx?6,103,249,0,1


'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()


dim i_Day
dim i_Month
dim i_Year


i_Day = CInt(Left( DTSSource("Need By Date"), 2 ))
i_Month = CInt(Mid( DTSSource("Need By Date") ,4, 2 ))
i_Year = CInt(Right(DTSSource("Need By Date"),4))


DTSDestination("NEED_BY_DATE") = DateSerial( i_Year , i_Month ,i_Day )




Main = DTSTransformStat_OK
End Function

Thanks in advance help.

--
Message posted via http://www.sqlmonster.com



Reply With Quote
  #4  
Old   
Sim Poay See via SQLMonster.com
 
Posts: n/a

Default Re: Data Overflow - DTS - 03-14-2005 , 07:46 PM



Hi Darren,

The test data and the real data is the same. May be I can send you the
snapshot?

From
Sim

--
Message posted via http://www.sqlmonster.com

Reply With Quote
  #5  
Old   
Sim Poay See via SQLMonster.com
 
Posts: n/a

Default Re: Data Overflow - DTS - 03-14-2005 , 07:54 PM



Hi IIya,

It should be 'NEED_BY_DATE' not 'DateX'.

From
Sim

--
Message posted via http://www.sqlmonster.com

Reply With Quote
  #6  
Old   
Tim
 
Posts: n/a

Default Re: Data Overflow - DTS - 03-14-2005 , 09:54 PM



I often have to get data from an AS/400 and on that platform they
frequently put a "low val" of 01/01/0001 in date fields instead of
NULLs. I would trap them with a VBScript using the "IsDate" function.
If it was not a valid date I handled it as the situation called for.


Reply With Quote
  #7  
Old   
Sim Poay See via SQLMonster.com
 
Posts: n/a

Default Re: Data Overflow - DTS - 03-15-2005 , 03:14 AM



Hi All,

Thanks for fast feedback. I have found the solution for that. Just go to
control panel -> Regional setting -> Date -> Change the year from 2029 to
2060. Then open the SQL Enterprise Manager -> right click on your server
registration -> properties -> server setting tab -> two year digit ->
change to 2099 or what ever higher than the current setting.

From
Sim

--
Message posted via http://www.sqlmonster.com

Reply With Quote
  #8  
Old   
matex81
 
Posts: n/a

Default Data overflow - 03-23-2005 , 01:05 AM



i`m trying to use that simple code but it won`t works

my source data is varchar for exmple '20050101
and destination is smalldatetim

But i`m still getting an error with OVERFLOW
What`s wrong

Thanks for advice, Mate


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

Default Re: Data overflow - 03-23-2005 , 02:49 PM



The conversion here should be implicit but have a look here

Formatting Character Data into Datetime fields
(http://www.sqldts.com/default.aspx?249)

"matex81" <madamkie (AT) o2-dot-pl (DOT) no-spam.invalid> wrote


Quote:
i`m trying to use that simple code but it won`t works.

my source data is varchar for exmple '20050101'
and destination is smalldatetime

But i`m still getting an error with OVERFLOW.
What`s wrong?

Thanks for advice, Matex


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.