![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a way to set the destination column to NULL if there is a data type mismatch, like trying to insert a string into a numeric type column? Thanks. |
#3
| |||
| |||
|
|
in the ActiveX, you can put dim checking checking = DTSSource("Col002") if isnumeric(testing) = false Then DTSDestination("test2") = null Else DTSDestination("test2") = DTSSource("Col002") End if Ed "Stefan Wrobel" wrote: Is there a way to set the destination column to NULL if there is a data type mismatch, like trying to insert a string into a numeric type column? Thanks. |
#4
| |||
| |||
|
|
Right, but the data type of the destination column varies, so it won't always be isnumeric that i'm checking for. Thanks for the response, any other ideas? "Ed" wrote: in the ActiveX, you can put dim checking checking = DTSSource("Col002") if isnumeric(testing) = false Then DTSDestination("test2") = null Else DTSDestination("test2") = DTSSource("Col002") End if Ed "Stefan Wrobel" wrote: Is there a way to set the destination column to NULL if there is a data type mismatch, like trying to insert a string into a numeric type column? Thanks. |
#5
| |||
| |||
|
|
I do not think this will be possible because as you say you have no idea what is the source and what is the destination datatypes. Also you may not want to abort the insert because the datatypes and data may be implicitly convertable -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - SQL Server 2005 Integration Services. www.Konesans.com "Stefan Wrobel" <StefanWrobel (AT) discussions (DOT) microsoft.com> wrote Right, but the data type of the destination column varies, so it won't always be isnumeric that i'm checking for. Thanks for the response, any other ideas? "Ed" wrote: in the ActiveX, you can put dim checking checking = DTSSource("Col002") if isnumeric(testing) = false Then DTSDestination("test2") = null Else DTSDestination("test2") = DTSSource("Col002") End if Ed "Stefan Wrobel" wrote: Is there a way to set the destination column to NULL if there is a data type mismatch, like trying to insert a string into a numeric type column? Thanks. |
![]() |
| Thread Tools | |
| Display Modes | |
| |