Cannot cast the error output on a SSIS insert task - ssis

We are doing a SSIS package to do some data transfer and insert it in a table (SQL SERVER 2008). It fails for one of the row and we want to log the issue by redirecting the error output. So far so good.
The problem is it won't let us cast one of the column, a DT_I4, to a string (DT_STR or DT_WSTR).
We get this error everytime :
[Log History Write Error [338]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR
The funny part is, if we change our destination element to a fast-load, we are actually able to cast the error output to a string.
Would anybody know why is that?

Related

Why power bi gives the following error :Fatal error encountered during data read.. '?

When I am trying to get my data from MySQL in Power bi, after some time power bi gives the following error: Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DataSource.Error] MySQL: Fatal error encountered during data read.. '.
Since I am working with json data type, I assume that perheps there is a problem with that, but how to solve this error?
I was looking for solution but I found only something about changing data type. So I did so but it stils gives me this error.
The error there seems to be about the data source not the data type.
We ve had few of these before, it might have to do with some edit done in the data source which i assume in an SQL database.
One solution would be to revoke PBI access and grant it again.

Problem to import datetimeoffset from csv file to a table via SSIS

I've a csv as a source file that I'm trying to load the data from this file to a stage SQL server table. There are three date columns. The below is an example of values of these columns:
2007-10-02T08:46:13+02:00
On SQL server side, I've defined datetimeoffset(7) as datatype and in SSIS connection manager selected database timestamp with timezone [DT_DBTIMESTAMPOFFSET] as datatype. But I'm getting the following error for importing datetime columns:
Data conversion failed. The data conversion for column "column1"
returned status value 2 and status text "The value could not be
converted because of a potential loss of data.".
Error: 0xC0209029 at
Data Flow Task, Flat File Source [2]: SSIS Error Code
DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Flat File
Source.Outputs[Flat File Source Output].Columns[column1]" failed
because error code 0xC0209084 occurred, and the error row disposition
on "Flat File Source.Outputs[Flat File Source
Output].Columns[column1]" specifies failure on error. An error
occurred on the specified object of the specified component. There
may be error messages posted before this with more information about
the failure. Error: 0xC0202092 at Data Flow Task,
Flat File Source
[2]: An error occurred while processing file "\path to file.csv" on
data row 2. Error: 0xC0047038 at Data Flow Task, SSIS.Pipeline: SSIS
Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Flat
File Source returned error code 0xC0202092. The component returned a
failure code when the pipeline engine called PrimeOutput(). The
meaning of the failure code is defined by the component, but the
error is fatal and the pipeline stopped executing. There may be
error messages posted before this with more information about the
failure.
Do you how to fix it? Or why I'm getting this error?
try first to load it as string (length 25 or so) and then try to substring it using Converting Columns in ssis and then you can try and cast it to datatype of datetime in another Converting Columns before loading to your table.
In the Flat File connection manager, leave the column data type to string (DT_WSTR or DT_STR) and in the Data Flow Task add a Derived Column Transformation with the following expression:
(DT_DBTIMESTAMPOFFSET, 7)REPLACE([DateColumn],"T"," ")
Example:
I was having the same problem. When i tried to export data that already have date time stamp it produces date format like below. If you change your date format i hope it will work.
My date format -> 2022-09-14 11:00:00.0000000 +00:00
Your date format -> 2007-10-02T08:46:13+02:00

Multiple SSIS Package errors

I have an SSIS package that was built 3 years ago by someone else that is long gone. I have ran it multiple times over the past year, and now I am getting these errors and I do not know why they are coming up. This ssis package imports from an excel doc to a temporary table. Once the info is on the temp table the second time it is run, it takes from the temp table and inserts it with additional columns into the production table. These are the errors I am getting:
[OLE DB Destination [162]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has
occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult:
0x80004005 Description: "Unspecified error".
[OLE DB Destination [162]] Error: There was an error with input column "UserProfileID" (299) on
input "OLE DB Destination Input" (175). The column status returned was: "The value violated the
integrity constraints for the column.".
[OLE DB Destination [162]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The
"input "OLE DB Destination Input" (175)" failed because error code 0xC020907D occurred, and
the error row disposition on "input "OLE DB Destination Input" (175)" specifies failure on
error. An error occurred on the specified object of the specified component. There may be
error messages posted before this with more information about the failure.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on
component "OLE DB Destination" (162) failed with error code 0xC0209029 while processing input
"OLE DB Destination Input" (175). The identified component returned an error from the
ProcessInput method. The error is specific to the component, but the error is fatal and will
cause the Data Flow task to stop running. There may be error messages posted before this with
more information about the failure.
When I saw "error with input column 'UserProfileID'" i looked at it in the temp table and it is null. This is one of the columns that the package is supposed to find when it is run. But I don't know if that info is found with the second run or if it is supposed to populate the first time. So I am unsure if that is what the problem I am having is.
I appreciate any help that I can get. If any additional info is needed I can try and provide it. Thank you to anyone that can offer help.
Has the table had it's structure changed recently? If the field did not have a constraint before, and has one now, then you need to address the issue in your SSIS package to move any records which do not meet the constraint to an exception table or you need to find out why the constraint was added when it is not appropriate for the type of data being imported.
The next place I would look is the Excel file. When a package has been running a file for some time and suddenly has problems and there have been no changes to the structure of the table the data is being inserted into, then it is likely the data in the file is wrong.
I think the important part of the message is:
"The value violated the integrity constraints for the column."
Does your destination allow null values in that field?
Can you insert the row manually?
If you take out the rows with null values in that field, does it run successfully?
re: your comment
the file I have been assured has no mistakes in it
If you can identify rows that won't import because of null values in a field, can you send that set back and ask the guy if the rows are valid, because they're breaking the import?
OK, from your additional information, I can see the problem is the null value in the userProfileID field which doesn't allow nulls. The question then becomes, what process is supposed to correctly determine the userProfileID value? Is it the updateIDs step? Is it copied directly from the Excel input file?

how to insert data from table to view using ssis 2008 R2?

While importing data i am getting error corresponding view not available in the db. But i checked in the DB that view is available . I tried manually insert into view that time its working.
Any setting to change for this?
While data importing from table to view via SSIS . I 'm getting following error "Invalid object name [Feed].[VwPharmaClaim]." This already exists. I traced the query in the profiler Quotes surrounded with the object name as ("[Feed]"."[VwPharmaClaim]").Without the quotes its working.
While I'm inserting data in 2008 version I am getting following error
Msg 208, Level 16, State 1, Line 1
Invalid object name '[Feed].[VwPharmaClaim]'
I traced the insert query in profiler
exec sp_executesql N'INSERT INTO "[Feed]"."[VwPharmaClaim]" ("PharmaKey","member_id","MemberRefID","claim_id","ndc","days_supply","refill_number","fill_dt","paid_dt","prescriber_id","allowed_amt","paid_amt","Member_amt","quantity","Import_Id","age") VALUES (#P1,#P2,#P3,#P4,#P5,#P6,#P7,#P8,#P9,#P10,#P11,#P12,#P13,#P14,#P15,#P16)',N'#P1 bigint,#P2 varchar(8000),#P3 numeric(18),#P4 varchar(8000),#P5 varchar(8000),#P6 numeric(10),#P7 int,#P8 datetime,#P9 datetime,#P10 varchar(8000),#P11 money,#P12 money,#P13 money,#P14 float,#P15 numeric(18),#P16 int',1,'000000000052',52,'085565501321 ','00472030115',5,0,'2008-06-04 00:00:00','2008-06-08 00:00:00','BO5586396 ',$10.0000,$0.0000,$10.0000,15,7,5368
OUTPUT
Msg 208, Level 16, State 1, Line 1
Invalid object name '[Feed].[VwPharmaClaim]'.
When I remove the double quotes it’s working fine
exec sp_executesql N'INSERT INTO [Feed].[VwPharmaClaim] ("PharmaKey","member_id","MemberRefID","claim_id","ndc","days_supply","refill_number","fill_dt","paid_dt","prescriber_id","allowed_amt","paid_amt","Member_amt","quantity","Import_Id","age") VALUES (#P1,#P2,#P3,#P4,#P5,#P6,#P7,#P8,#P9,#P10,#P11,#P12,#P13,#P14,#P15,#P16)',N'#P1 bigint,#P2 varchar(8000),#P3 numeric(18),#P4 varchar(8000),#P5 varchar(8000),#P6 numeric(10),#P7 int,#P8 datetime,#P9 datetime,#P10 varchar(8000),#P11 money,#P12 money,#P13 money,#P14 float,#P15 numeric(18),#P16 int',1,'000000000052',52,'085565501321 ','00472030115',5,0,'2008-06-04 00:00:00','2008-06-08 00:00:00','BO5586396 ',$10.0000,$0.0000,$10.0000,15,7,5368
OUTPUT
(1 row(s) affected)
My package developed 2005 . I have converted this package to following version in 2008.
version 9.0.30729.4462.QFE
This My error while importing data from table to view
[OLE DB Destination [185]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E37 Description: "Invalid object name '[Feed].[VwPharmaClaim]'.".
By default in SQL Server 2008 you are not allowed to use double quotes to identify database objects.
Run
ALTER DATABASE <dbname> SET QUOTED_IDENTIFIER = ON
against your destination database and then try running
SELECT * FROM "Feed"."VwPharmaClaim"
Check out http://technet.microsoft.com/en-US/library/ms174393(v=sql.105).aspx for some more info.
When you say SSIS is generating these queries, what sort of task are you using to generate them? I've never seen it produce double quote identifiers before, just curious.
I experienced this with SSIS 2013 and trying to insert to an updatable view. This view uses an 'instead of' trigger to do the insert.
In order for it to work, I had to go into the advanced editor for the destination and on the component properties tab remove the square brackets from the OpenRowset, so [dbo].[myView] becomes dbo.myView. Also, the AccessMode needs to be plain OpenRowset; fastload does not work.

ssis sql 2000 image to 2008 varbinary Failed to retrieve long data for column

I have a task that to migrate the image type column from sql 2000 to varbinary type in sql 2008.
The source column having 3812353 max datalength size for the column.
The package always failed with following error message.
[OLE DB Source [13177]] Error: Failed to retrieve long data for column "attch_file_content_t".
[OLE DB Source [13177]] Error: There was an error with output column "attch_file_content_t" (13209) on output "OLE DB Source Output" (13187). The column status returned was: "DBSTATUS_UNAVAILABLE".
[OLE DB Source [13177]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "attch_file_content_t" (13209)" failed because error code 0xC0209071 occurred, and the error row disposition on "output column "attch_file_content_t" (13209)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
It basically was the connection error.
i manage to solve the connection issue on one table but now found another issue on another table.
The initial intention is migrate the source data to staging.
The source are sql 2000, they have some attachment as an image type
Then we have the Failed to retrieve long data for column issue when we just do the select * from tableA
Then I try to do the select cast(ImageTypeColumn) as varbinary(8000) from tableA
now it work for those data which is not exist 8000 byte
But unfortunately in the another table, there exist some rows data length is huge.
Thus it failed again when we do the select cast(ImageTypeColumn) as varbinary(8000) from tableA
In Microsoft SQL Server 2000 and earlier versions, the varbinary data type had a maximum limit of 8,000 bytes. To store up to 2 GB of binary data the image data type needs to be used instead.
Finally i found a solution on that.
Using ADO.net Source instead of using the OLEDB.net Source