Convert date from access to SQL Server with SSIS - ms-access

I want to convert a database from access to SQL Server using SSIS. I cannot convert the date/time columns of the access db. SSIS says something like:
conversion between DT_Date and DT_DBTIMESTAMP is not supported.
(Its translated from my German version, might be different in English version). In Access I have Date/Time column, in SQL Server I have datetime. In the dataflow chart of the SSIS I have a OLE DB source for the access db, an sql server target and a data conversion. In the data conversion I convert the columns to date[DT_DATE]. They are connected like this:
AccessDB -> conversion -> SQL DB
What am I doing wrong? How can I convert the Access date columns to SQL Server date columns?

Looks like you'll need to add a specific conversion to convert this column to the correct type. It's the DT_DBTIMESTAMP that you need to convert to, not DT_DATE. Using a Derived Column Transformation for instance, you could use an expression like:
(DT_DBTIMESTAMP)YourDateColumn

You use another Provider on the source side. I used the JET provider. I am doing this on a computer where no Access is installed. When I try to create a data connection using the Office 12.0 Access Database Engine OLE DB Provider I get an error message that the workgroup information file is missing. I get this message on the connection test.
The question is if the conversion depends on the db driver you use to get the data. I cannot install Access on the server I am working, so I cannot try it. Could this be the cause of the problem?

Casting D_Date column to DT_DBTIMESTAMP solve the same problem for me.

Related

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.

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 2008 mySQL source to SQL 2008

I need to copy data from a remote mySQL database into MSSQL Server 2008 database using SSIS 2008 package. I have some Timestamp fields in the mySQL database giving me problems. When l excluded the Timestamp fields l managed to copy the data nicely. On the OLE DB Destination Input - Input Columns the field which is Timestamp on mySQL database is showing as having data type DT_Bytes.
I am getting the error An OLE DB record is available.
Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
[OLE DB Destination [784]] Error: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
My select statement to the mySQL source has got a select case to handle 0 dates it is like;
SELECT case modified_date when day(modified_date) = 0 then '1990-01-01 00:00:00' else modified _date end as modified from mySQLTableName
The problem is definitely with your data types. Open up your Destination component for editing. Go the mapping tab. Hover over each column mapping, first the source column, then the destination. The tooltip will show you what the data types of each column are. One of them doesn't match.
It's most likely your timestamps field, but it might not be, so I won't speculate.
In any case, to make them match, add a Data Transformation component in between your source and destination, and recast the offending source column to the data type you want for inserting into SQL Server. (If the recasting also causes an error, it'll be a lot more helpful one than this one!)

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.

OLE DB to get BlobColumn Data in SSIS Dataflow

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.