OLE DB to get BlobColumn Data in SSIS Dataflow - ssis

When I use ADO.net source in DataFlow to read Blob Column and pass it to Script Component to do further validations - need script compoment to do further validations on each column to generate master / child error records master (for each row) and child (for each error column). This works fine.
As I need to parameterize my source, I can't use ADO.net and instead need to use the OLEDB Source which supports parameters. When I use this OLEDB source, the script component doesnt recognise the BLOB data being passed by OLEDB source. It reports datatype problems i.e., convering nonunicode to unicode.
How can this be done.
Regards

Can you confirm what your source database is (SQL Server, Oracle, etc).
I had the same problem using the 'Oracle OLEDB provider for Oracle' data source. The provider seems to convert every varcahr into an nvarchar. I solved this by adding a 'data conversion' component, and explicitly converting all nvarchar columns to varchar here.
The new columns are incuded in the output of this compnent, so you can link them to the fields on your spreadsheet.

Related

SSRS Dynamic data source is not working

I have a dynamic data source in my SSRS Report. It will get its server name from a parameter defined in the report. I defined my dynamic data source connection string as
="Data Source="+Parameters!HostServer.Value+";Initial Catalog=DBName"
When I am trying to define a data set using this data source, I am not able to extract the fields out of the query used in the data set. The error I am facing is that "Could not update a list of fields for the query. Verify that you can connect to the data source and the query syntax is correct..."
If I use the same query against my server in SSMS editor, I am getting expected output. And the parameter has already a default value which I suppose the report will use while testing connection.
If anyone know how to resolve this connectivity issue with dynamic data sources, please help.
You should create another temporarly datasource where you need to set connection to one of your databases. Then when you define dataset use that temporarly datasource in order to populate the available fields. Once the fields are created, you can change the connection back to your dynamic data source. After that delete temporarly datasource and it all should to work.

SSIS: cannot convert between unicode and non-unicode string data types

I am working in SQL Server 2008 and BIDS (SSIS). I have a simple data flow task in which I'm importing a flat file into an OLE DB destination. On the OLE DB destination, I'm getting an error message, stating "cannot convert between unicode and non-unicode string data types".
Now, I know one solution method is to put a data conversion in between the flat file and the OLE DB destination. However, my concern is why this is even happening in the first place. In the connection manager for the given flat file, all columns are string (DT_STR) data types, and the Unicode option is unchecked. Similarly, all columns in the destination table (upon the inspection of the metadata in SSMS) are varchar data types. So, there is no nvarchar-to-varchar mapping going on at all.
Why is SSIS thinking that I have a unicode-to-nonunicode mapping happening? And, is there an easier way to resolve this than inserting a data conversion step for the columns that have this problem?
[Since I don't seem to be allowed to comment on the question, I'm having to put my question here.]
Have you checked the table you're trying to insert the data into to see if the columns in the table are varchar or nvarchar? The SSIS metadata could be out of sync with the database table.

What should the converted data type of the corresponding column within the Data Converter SSIS Data Flow Component be?

We have the plain Microsoft SQL Server 2008 on one of our servers
We decided to create DTSX files on the filesystem so that we can use BIDS 2008 to open the DTSX files
One SSIS Control Flow Components that takes data from around 18-19 columns from a Microsoft SQL Server 2008 SQL select query, and then converts the values in order to place them in the Microsoft Access table. I have a number of columns that I retrieve from Microsoft SQL Server 2008 table using a DataFlow Component called OLE DB Source. After retrieving the data, I have a Data Converter data Flow Component that converts the values. Finally, the converted values are placed by an OLE DB Destination data Flow Component, and placed in a Microsoft Access table.
For one of the columns from a Microsoft SQL Server 2008 , the data type is varchar(5)
The value in the above varchar(5) column needs to be extracted from Microsoft SQL Server 2008 using a SSIS DataFlow Component called OLE DB Source as a string [DT_STR] Data Type
It needs to converted using the Data Converter SSIS data Flow Component
Finally, it needs to placed in the Microsoft Access table to a column of the data type called Text.
What should the converted data type of the corresponding column within the Data Converter SSIS Data Flow Component be?
You can refer below resources.
Integration Services Data Type Mapping
Data Type Translations
Integration Services Data Types
#vikramsinh-shinde Thanks for the webpage links. The following implementation seemed to ensure that the SSIS package ran properly, however, I hope it's the proper way to handle conversion in the SSIS packages.
-varchar(5) column values in Microsoft SQL Server 2008
-extracted as string [DT_STR] that has a length of 5 and Codepage of 1252 within SSIS DataFlow Component called OLE DB Source
-converted to Unicode string [DT_WSTR] that has length of 5 ( and non-modifiable codePage of 0 ) within SSIS Data Flow Component called Data Converter
-loaded into Microsoft Access column values of data type called Text

Extract data from Sybase ASE 15 using SSIS 2008 in Unicode format

I'm attempting to use SQL Server Integration Services (SSIS) 2008 R2 to extract data from a Sybase ASE 15 database.
I've managed to configure the OLE DB Source with the correct connection information and can see the tables and data. However no matter what I try it always returns DT_STR columns.
I would like to have the data returned in Unicode format, without using the Derived Column / Data Conversion task, as the destination tables are all defined with NVARCHAR (DT_WSTR) column and it would be a bit of a pain to have to go through every column just to change the type.
Is there a way to define the connection string / set defaults on the login / other method to ensure that the OLE DB Data Source returns DT_WSTR columns instead of DT_STR when running a query?
Many thanks,
John
Right click on the OLE DB Data source and select the Advanced Editor. Then go to the Input and output Properties tab.
Select the column that you're importing and change its dataType on the properties display on the right.
Alternatively you could have your OLE DB Source use a query to return its columns. Your SELECT statement can then CAST() your columns into the type you need.
I don't know why you dont want to use a derived column/data transformation transformation tho. It seems like it would be just the same amount if not more work

SSIS package creation for integrating MSSQL and MySql dbs

I am trying to create an SSIS package for integrating between MSSQL and MYSQL. I have no prior experience of working with Bids or SSIS and following the instructions from here.
I added the OLE DB Source, Lookup, Conditional Split, OLE DB Destination and OLE DB Command components to the Data Flow and configured the connection managers and column mappings upto the Conditional Split component.
From here, I am facing two problems -
1) After configuring the OLE DB Destination, it shows error symbol on the component that says could not convert between unicode and non unicode string datatypes. To solve this, I tried to insert a Data Conversion Component between the Conditional Split and the Destination and configured it for the problematic column. But that doesnt seem to help
2) While configuring the OLE DB Command, the right hand side column in Column mappings tab shows zero columns. I have added the Sql command with question marks so i guess it should be showing columns named "Param_0", "Param_1" etc if i am not wrong. I even tried to add them manually from the input and output properties tab but then it shows the warning, external columns for OLE DB command are out of sync with data source
What am I missing here ?
Thanks
The way you describe your first problem, it sounds like it should work. Here are a couple of things to check.
The data conversion component creates a new column for the converted data. Make sure you are referring to it in your following transformations and destination.
Right-click on the Data Conversion component and select Advanced Editor. Select the Input and Output Properties tab in the Advanced Editor. Expand the Data Conversion Output branch of the tree-view and select your new column. Ensure that the Data Type Properties show the data type that you want to convert too. If these values are not right then something is not right with the setup in the component.
For your second problem, the issue can frequently be caused by an error with the SqlCommand value. First, make sure the Connection Manager is correct on the Connection Manager tab. Switch to the Column Mappings tab. Near the bottom of the form, there may be a warning message that indicates that the SQL statement cannot be prepared. In other words, SSIS can't figure out what the statement is supposed to do. Address any problems with the SQL statement and switch back to the Column Mappings tab. The columns will appear once the SQL statement can be parsed.
If you want to avoid the conversion issues then change your destination table column types from char/varchar to nchar/nvarchar. I'm pretty sure you will need to use an ADO connector for mysql source and destinations, you should be able to read data from the mysql source and write to the mssql database w/o using anything other than source and destination components.