Importing from Oracle to SQL Server - sql

I am using SQL import/export wizard to import a table from oracle, SQL wizard is generating the following error.
TITLE: SQL Server Import and Export Wizard
------------------------------
Could not connect source component.
Error 0xc0202009: Source - PORTRAIT [1]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
Error 0xc02020e8: Source - PORTRAIT [1]: Opening a rowset for ""FLDADMIN_TEST"."PORTRAIT"" failed. Check that the object exists in the database.
------------------------------
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)
Although I can import other table without any problems. I noticed that Portrait table is partitioned, if this is the problem?how can I import such table?
Thank you,
Ihab

Related

Violation of Primary Key Constraint; SQL Server Express

First, I am using SQL Server 2014 Express.
Second, I am using the SQL Server 2014 Import and Export Wizard.
I have imported a few items successfully using this same program. This is the exact error:
Error 0xc0202009: Data Flow Task 1: 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 11.0"
Hresult: 0x80004005
Description: "The statement has been terminated.".
An OLE DB record is available.
Source: "Microsoft SQL Server Native Client 11.0"
Hresult: 0x80004005
Description: "Violation of PRIMARY KEY constraint 'PK_GEOG'. Cannot insert duplicate key in object 'dbo.geog'. The duplicate key value is (00, 06, 000001).".
(SQL Server Import and Export Wizard)
This is coming from a flat file source. I have imported this into excel and access and ran various tests. There is no other row in the database that contains (00, 06, 000001) in the first three columns.
These columns make up the primary key (state, type, area). I am no expert but I was not able to find a trigger connected to this table (GEOG).

SQL Azure Import Error - Operand type clash: image is incompatible with geography

My database contains a table with Geography column having spatial data.
Importing its .bacpac (Data-tier App) on SQL Azure Standard fails without giving any proper error details.
Tried a direct Data Export using wizard and received an error:
Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80004005 Description: "Operand type clash: image is incompatible with geography".
(SQL Server Import and Export Wizard)
Any idea why Geography is a problem here?
Update
I recently upgraded SSMS to 2016 and this error has gone. It must have been due to older version of SSMS that didn't support import export of spatial data.

Multiple-step OLE DB operation generated errors...SSIS VS2005 Business Development Studio

When developing SSIS package using VS 2005, I set up the connection manager for oledb teradata provider and added a oledb source and destination. For oledb source, I used the data access mode as sql command and added sql command text. But when I tried to do column mapping, I'm getting an error message which is detailed below.
Error at All Transactions [OLEDB Source [1627]]:
An OLEDB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "OLE DB Provider for Teradata" Hresult:
0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check
each OLE DB status value, if available. No work was done.".
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0202009 (Microsoft.SqlServer.DTSPipelineWrap)
BUTTONS:
OK
Please let me know why such error throws. I have a workaround which is described as follows.
when you store the sql within ( and ) and alias the query and set the data access mode as table name or view name variable, then it works fine.
Without any more information on the SQL being used in the OLEDB Source component, I can try and guess. Maybe the issue is with the SQL that is returning columns with the same name or similar situation that leads to incorrect metadata.
I just got this error and I simply edited the provider to a different provider, tested, and then set it back to the original provider. In my case I was using OLEDB Native client 11 so I set it to 10 and then back to 11.
My guess is the XML got corrupted somehow as my package has been working forever.

Convert SQL Server 2012 database to MS Access 2010

I have done all kind of tries. Naybe I have done something wrong. Can you suggest me how to import data from SQL Server to Access?
I did export from SQL Server (right click and task export)
I got errors like:
Error 0xc02020c4: Data Flow Task 1: The attempt to add a row to the
Data Flow task buffer failed with error code 0xC0047020. (SQL Server
Import and Export Wizard)
I did import from Access and I tried thru ODBC connection and it also failed.
If anyone has the exact steps or any converters software link then it will be great.

Unable to import data into SQL Server from Progress DB, issue with data type conversion?

I'm trying to import data from a Progress database into a MS SQL 2005 Server database.
On SQL Server, I'm right clicking on my schema name and going Tasks > Import Data... and running through the wizard.
I have an ODBC Connection to progress setup, no issues there, I also test my queries using ODBC Explorer first to ensure I have no syntax issues.
A statement that I'm using is as follows:
SELECT "MYTABLE"."FIRST-NAME",
"MYTABLE"."LAST-NAME",
"MYTABLE"."D-O-B"
FROM PUB."MYTABLE"
This works fine in ODBC Explorer, but when I try to use this in SSIS I get the following error
Executing (Error)
Messages
Error 0xc02090f5: Data Flow Task: The component "Source - Query" (1) was unable to process the data.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - Query" (1) returned error code 0xC02090F5. 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.
(SQL Server Import and Export Wizard)
Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited.
(SQL Server Import and Export Wizard)
Error 0xc0047039: Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED. Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. There may be error messages posted before this with more information on why the thread was cancelled.
(SQL Server Import and Export Wizard)
Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited.
(SQL Server Import and Export Wizard)
My first thought was maybe an issue between the Date data types between Progress and MSSQL, so I have tried TO_CHAR in my statement (tested in ODBC Explorer first) but that didn't resolve it, I've tried everything I can think of including
Using TO_CHAR in the Progress
Select statement
During the data mappings in SSIS; try using Datetime, smalldatetime, nvarchar
etc..
Using TO_CHAR and NVL
Increasing the size of all destination columns to 200 (no columns need more than 50 at current so this is more than enough)
Even removing that Date field from the select statement still produces the same error
Is there anything I have missed? Is it possible that the source data could be incorrect and not supported in SQL Server?
I have found some posts on MSDN suggestion that there could be an issue with data type conversion and there may also be an issue with the overflow of data in Progress columns
This seems to be an intermittent issue, I have other data import jobs from Progress that use dates and there are no issues (and yes, I have cross-referenced all settings to ensure I haven't missed something)
My only option seems to be to move data from Progress > Access (or some other DB) > MS SQL
The Progress DB stores all data as variable length. This often causes problems with databases that expect data to be fixed length. The solution is to run the "dbtool" utility.
dbtool is in the Progress "bin" directory. You want option #2 "SQL Width Scan w/Fix Option".
When in doubt:
Progress --> CSV file --> SSIS --> SQL
Server
I've had good luck using a SQL Linked Server object to connect the Progress Database, via the Microsoft OLE DB Provider for ODBC Drivers. You need to use the OpenQuery object to query the linked server, which looks like:
select MyField, MyOtherField from OpenQuery ([MyLinkedServer],'select MyField, MyOtherField from PUB.My_ProgressTable where dtLastUpdated > {d ''2009-01-31''}')
For the ODBC DSN setting the Default Isolation Level on the Advanced Tab to 'READ UNCOMMITTED'
This is using SQL 2005 against a Progress 10.1B db on a Linux server. Not the most elegant or efficient solution perhaps, but it's been pretty reliable.
Same issue here (INFORMIX 3.81 32 BIT driver via ODBC)
Reason: SSIS fails at empty strings: ''. Maybe it can`t differs it from NULL.
Resolution: instead of:
select col from xxx
put:
select case when col = '' then NULL else col end col from xxx
works for me.