Rexolio
Technical User
- Aug 29, 2001
- 230
I have a flat file that I need to set up a DTS to extract the data and add to my SQL Server database table a few times a week.
I'm running into a problem:
Here is the flat file:
Here is the table I'm trying to pull it into:
I've mapped all of the fields in DTS. However, I choose <ignore> for Destination column id (because I have no option to remove "id" from the DTS package. If I just do a standard insert, since id is an identify field, it adds a number automatically.
Then, for transformation, I use:
Right now I'm concerned about the error stating I'm trying to insert a NULL value into column id. How do I get around that.
However, I have also gotten an error stating that "DTSSource" is an invalid call or argument, so I can only assume that once I fix the NULL problem, this will come back.
PLEASE HELP!
I'm running into a problem:
Code:
insert error, column 1 ('id', DBTYPE_I4), status 10: Integrity violations; attempt to insert NULL data or data which violates contraints.
Here is the flat file:
Code:
name, street, address, city, zip
Adam, 123, Main, Polk, 30188
Joe, 2053, Main, Polk, 30188
Tom, 320, Main, Polk, 30188
Here is the table I'm trying to pull it into:
Code:
id, name, address, city, zip
I've mapped all of the fields in DTS. However, I choose <ignore> for Destination column id (because I have no option to remove "id" from the DTS package. If I just do a standard insert, since id is an identify field, it adds a number automatically.
Then, for transformation, I use:
Code:
Function Main()
DTSDestination("name") = DTSSource("Col001")
DTSDestination("address") = DTSSource("Col002") & " " & DTSSource("Col003")
DTSDestination("city") = DTSSource("Col004")
DTSDestination("zip") = DTSSource("Col005")
End Function
Right now I'm concerned about the error stating I'm trying to insert a NULL value into column id. How do I get around that.
However, I have also gotten an error stating that "DTSSource" is an invalid call or argument, so I can only assume that once I fix the NULL problem, this will come back.
PLEASE HELP!