![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am using DTS to import an Excel spreadsheet into a Sql database table, but I am having trouble with one column. The table does not allow for any nulls, all data must be imported. Most of the time the column is alphanumeric, but occasionally it is numeric. I tried using "Copy Column" for the transformation of all fields. I have also tried to get it to work by adding VBScript to the transformation (see below), but it still doesn't recognize the numeric values which causes the package to fail since null values are not allowed for the field. I have a different client that has a similar problem and I require that he put a tick(') in front of the numeric instances, which works perfectly well. Unfortunately, this type of manual entry is not an option for this client. vbscript: Function Main() IF IsNumeric( LTRIM(RTRIM(DTSSource("Authorization Number")))) THEN DTSDestination("ECMDAuthorizationNum") = CSTR(LTRIM(RTRIM(DTSSource(" Authorization Number")))) ELSE DTSDestination("ECMDAuthorizationNum") = LTRIM(RTRIM(DTSSource(" Authorization Number"))) END IF Main = DTSTransformStat_OK End Function Example 1 (does not work): TK727503 TK727503 25071 Example 2 (does work, but requires manual entries): TK727503 TK727503 '25071 Any suggestions/help would be greatly appreciated. Thanks in advance, Amy Bolden |
#3
| |||
| |||
|
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |