Derived Column Transformation Length Error: - ssis

I am new to SSIS and trying to use the Derived Column Transformation, but after setting up the control flow I get this error:
I am loading the data from a View and I not sure why the Length and the Data Type columns aren't populated, any suggestion on the reason for error are helpful.

In SSIS, "DT_WSTR" cannot have a length greater than 4000.
Here, it tells you that it cannot determine the data type and length because the value exceed the expected range based on the matadata of the column you used.
To see the matedata of your colmns view, you can right click on the source activity and click on "Show advanced editor". In the popup click on "Input and output properties" and see the datatype of your columns:
If the length of the derived column can be greater than 4000, you have to use "DT_NTEXT" datatype.

Related

MS Access-2019, Data Type Mismatch

I am relatively new to MS Access-2019.
I'm attempting to create a calculated field from an adjacent field. I receive the following error message when I write the argument in the calculated field:
Data Type Mismatch in the Criteria Expression
Online research and the use of library references tell me that I'm attempting to create a calculated field with data with different attributes.
However, a careful review of the "criteria in the expression" does not seem to support this error message.
Specifically, the expression in the calculated field is:
LateFee:[AmountPd]*0.02
As you can see this is not a complex expression.
What am I missing?

stuck with data conversion SSIS

I'm stuck with a conversion problem...or atleast at datatype problem.
Trying to read a csv-file and update a SQL-database with its content.
The column I have problems with have numbers like 64,51 (at most 3 digits with 2 decimals).
In the database I have set the datatype as decimal(3,2) and in the flat file Connection manager I have set it as decimal(DT_DECIAL) with the scale of 2.
Along the flow I do a Derived column, merging two columns into one and then convert the new column.
Looking in the advanced editor of the OLE DB-destination I can see that in the Input Columns the column is set as DT_DECIMAL, but in the External column its set as a DT_NUMERIC.
How do I change that?
I can change the properties but every time it reverts back to numeric when I press OK.
The errormessage says: "Conversion failed because the data value overflowed the specified type."
Thanks for all tips on this!

SSIS data load truncates values into destination table

I have an SSIS package with a simple Source(vertica query) and Destination (sql DB). When I load the data my data values are cut off.
For example, I have a Country code and this is listed as "C" instead of "CN" . I tried to put a DATA CONVERSION and change the data type to DT_STRING, which normally works, but this time it doesn't seem to do anything. Any idea on how I can handle these truncation's. I have mapped the field lengths all the same from source to destination.
Go into the Advanced Properties of the Source component, and go into each of the Output Columns that has truncated data, and set the Length property of each of those columns to the maximum possible length that the data in that column can be.
Also take out your data conversion component, since you shouldn't need it and it might interfere with the results of the above change.

What's up with SSRS parameters and images?

I'm working on setting up a report in SSRS. Our report is somewhat flexible, and I'm looking to dynamically select an image for a cover page based on a parameter.
Here's what I have:
In our Reports db I have an image table set up. To keep things simple, lets just say I have three columns:
ImageName, ImageType, and Image.
Name and type are both varchar while ImageType is varbinary. I've uploaded the images we plan on using as well as their names and associated types to the table.
In my report I have a Data Source and a Dataset for bringing in the above table and columns.
I also have a parameter called "ImageName." I've set this parameter up to use "Image" (from the table described above) as its value field and the label field is set up for "ImageName."
On the report itself I have an image ... control? Report element? Not sure what to call it, but I've set up an image. The image source is set to "Database" and the MIME type uses the lookup function to pull the appropriate image type from the Dataset based on the Parameters!ImageName.Label argument - and that part works a treat - I'm returning the proper MIME type each time.
What doesn't work, and I would expect should work, is setting the image itself. For the "Use this field" field under "Select the image source:" I've tried both =Parameters!ImageName.Value with no success as well as a lookup based on the ImageName.Label from the images Dataset. Neither seem to work.
When I try using the parameter value, I'm getting the error
[rsInvalidDatabaseImageProperty] The value of the ImageData property
for the image 'ImageControlName' is "=Parameters!ImageName.Value",
which is not a valid ImageData.
I get essentially the same error message from the lookup method, it just swaps the lookup code for the Parameters!ImageName code above.
If I attempt to check the type returned by the lookup above I simply get an error. For the parameter if I check the type I get System.String so I decided to print that out and apparently the value of Parameters!ImageName.Value is System.Byte[] for some reason.
I can get an image to display using the First() function, but I need to be able to select the image. I'm guessing I may have to filter. First() has a return type of System.Byte[], which seems reasonable. I just don't understand why my parameter is returning the type of the image data column as a string rather than the data from the image column itself.
So how do I get this working? Is filtering my Dataset my only option? Or is there a way to get the parameter working or to get some function that will allow me to select the appropriate image?
Reason for your error is because of the data types returned by Parameters vs First.
For the Parameters data type returned is of type text and which is not valid image data type hence the error.
For First function it returns the data type based on type of expression and it returns the right type of data type for image and displays the image.
Per Microsoft Parameter Data Type:
A report parameter must be one of the following data types:
Boolean. The user selects True or False from a radio button.
DateTime. The user selects a date from a calendar control.
Integer. The user types values in a text box.
Float. The user types values in a text box.
Text. The user types values in a text box.
When available values are defined for a parameter, the user chooses
values from a drop-down list, even when the data type is DateTime.
Per Microsoft First function data type:
Return Type
Determined by the type of expression.
You are correct to get the right image you need to filter the dataset.
Create dataset which gives ImageName, ImageType, and Image.
Based on image parameter filter the dataset on ImageName.
Now use the following expression to get the correct image data.
=Fields!Image.Value

Have SSIS detect the column sizes of a csv file

I'm trying to import a csv file into SQL using SSIS and am hitting a fundamental flaw.
SSIS seems to determine that all fields are varchar(50), even though it correctly identifies the comma delimiter.
This is causing issues when I try to send the data to my table in SQL.
Is there a way of making it recognise that a field of length 3 is actually a field of length 3, and not 50?
Thanks
Yes, there's a Suggest Types function in the Flat File Connection Manager Editor.
Assume you have got a CSV file shown in the first image.
Create a new Flat file connection, and browse this file on your computer. The Columns tab shows the sample of the file.
Click Advanced tab. There you can see all columns have DT_STR type with the length of 50. What you can see is the Suggest Types... button. Click this.
Set parameters as you like. Defaults are all right in my case. Click OK.
Now the first column has the type of DT_STR with the length of 1. (The other two columns have got new types as well. The Number column got DT_I1 (because we choosed the smallest appropriate integer type option), and the Date column got DT_DATE.