September 7, 2022 at 1:42 pm
I'm having difficulties performing a Data Flow Task between a .csv file to OLE DB. By default, the column [ID] is in DT_STR datatype. It throws the following generic error:
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "Invalid character value for cast specification".
I have tried changing to a few String & Number data type. It will still show the same generic errors. However, if I select DT_I4 and set the FastParse (in Flat File Source's Advanced Editor), the Data Flow Task will run successfully, but the ID becomes 0.
Note that there are values in the ID column in the csv file. Appreciate if anyone could advice me on what can be done.
September 7, 2022 at 1:50 pm
What is the datatype of the target ID column? VARBINARY, perhaps?
Is it ContentTypeId that you are mapping to it?
If yes, to both, try setting the SSIS datatype to Byte Stream.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
September 7, 2022 at 1:59 pm
I'm trying to map to the ID column in SQL. This is the table I'm mapping my csv file to:
CREATE TABLE [csv].[File_Stage](
[Id] [INT] NULL,
[ITS Service ID] [VARCHAR](250) NULL,
[Service Name] [VARCHAR](250) NULL,
[Web Application Name] [VARCHAR](250) NULL,
[Status] [VARCHAR](50) NULL,
[Service Owner] [VARCHAR](250) NULL,
[BUIT Service Owner] [VARCHAR](250) NULL,
[Business Unit] [VARCHAR](50) NULL,
[Country] [VARCHAR](100) NULL,
[Country Code] [VARCHAR](50) NULL,
[Asset ID] [VARCHAR](50) NULL,
[IT Domain] [VARCHAR](250) NULL,
[Description] [VARCHAR](4000) NULL,
[Product ID] [VARCHAR](50) NULL,
[Service Criticality] [VARCHAR](50) NULL,
[Data Classification] [VARCHAR](50) NULL,
[Security Level] [VARCHAR](50) NULL,
[Allowed from Internet] [VARCHAR](50) NULL,
[Application Type] [VARCHAR](50) NULL,
[Prod URLs] [VARCHAR](500) NULL,
[Non-Prod URLs] [VARCHAR](500) NULL,
[Link to Source Code] [VARCHAR](4000) NULL,
[Source Code Available] [VARCHAR](50) NULL,
[Scans for hardcoded secrets] [VARCHAR](50) NULL,
[Source Code Vendor] [VARCHAR](250) NULL,
[Vulnerability Scan Infrastructure] [VARCHAR](50) NULL,
[WAF Protection mandatory] [VARCHAR](50) NULL,
[WAF Protection done] [VARCHAR](50) NULL,
[WAF Protection Vendor] [VARCHAR](250) NULL,
[Manual Pentest possible] [VARCHAR](50) NULL,
[last test date Manual Pentest] [VARCHAR](250) NULL,
[SAST possible] [VARCHAR](50) NULL,
[last test date SAST] [VARCHAR](50) NULL,
[DAST possible] [VARCHAR](50) NULL,
[last test date DAST] [VARCHAR](50) NULL,
[ASVS possible] [VARCHAR](50) NULL,
[last test date ASVS] [VARCHAR](250) NULL,
[Flag Pentest critical high findings] [VARCHAR](50) NULL,
[Findings PenTest CRIT total] [VARCHAR](50) NULL,
[Findings PenTest CRIT closed] [VARCHAR](50) NULL,
[Findings PenTest HIGH total] [VARCHAR](50) NULL,
[Findings PenTest HIGH closed] [VARCHAR](50) NULL,
[Findings PenTest comments] [VARCHAR](4000) NULL,
[Flag DAST critical high findings] [VARCHAR](50) NULL,
[Findings DAST CRIT total] [VARCHAR](50) NULL,
[Findings DAST CRIT closed] [VARCHAR](50) NULL,
[Findings DAST HIGH total] [VARCHAR](50) NULL,
[Findings DAST HIGH closed] [VARCHAR](50) NULL,
[Findings DAST comments] [VARCHAR](4000) NULL,
[Modified] [DATETIME2](7) NULL,
[Created] [DATETIME2](7) NULL,
[GUID] [NVARCHAR](50) NULL,
[SourceSystem] [NVARCHAR](50) NULL,
[InsertedOn_DWH] [DATETIME2](7) NULL
) ON [PRIMARY]
GO
In SQL, the ID is in Int data type. Unless the issue is coming from the SQL table itself, where I had set the ID column as [Id] [INT] NULL
September 7, 2022 at 2:06 pm
OK, then add a Data Conversion task and convert the ContentId to an INT32, then map the converted column to ID.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
September 7, 2022 at 2:21 pm
Thanks Phil. But I don't think the ContentTypeID column is the issue. It's ID. I assume that the same solution can be applied there right?
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply