Re: DTS Import From AS/400 DB2

From: Jeff Turner (jturner_at_discussions.microsoft.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 08:47:02 -0700

Pete, thanks for the response.

I've tried to create a linked server using the the MS OLE DB provider for
DB2 with no success. I found an article that stated you must use MS SNA
Server or MS Host Integration Server to configure the data source for the OLE
DB provider (Microsoft Knowledge Base Article - 218590). Neither of which I
am running or have licensing for. I was able to create a linked server using
the ODBC OLE provider pointing at my Client Access ODBC DSN. However, I could
only return a few rows from my DB2 table(s) (i.e. my query returns 89 rows
from a table that has 62000+ rows using select * from
AS400.[owner].[library].[file]).

Regarding the PK's on my tables most use a key that is not in any sequential
order (i.e. a vehicle VIN number). I had an idea of making a join on the two
tables returning all row from my AS/400 table and only rows from my local
table where the join was equal, then looking for null values in a column from
my local table. I've done this in MS Access before and it works well for
appending new data (SELECT * FROM [AS/400 Table] LEFT JOIN [Local Table] ON
[AS/400 Table].VIN = [Local Table].VIN WHERE [Local Table].VIN Is Null;).
Unfortunately I have to figure out the linked server problem first.

-Jeff

"Peter A. Schott" wrote:

> I was using a linked server to do this. As long as your file has a PK you can
> use to just grab new rows, you should be in good shape. I had to turn on
> Collation Compatibility to get good performance.
>
> Another option would be to use an ActiveX script to set your SQL Query to
> something like:
>
> select * from OPENQUERY(AS400, 'select * from FILE where FILE_PK >
> MAX_PK_LOCAL')
>
> or
>
> select * from AS400.Owner.Library.File where File_PK > Max_PK_Local
>
>
> It can be done without too much trouble and could probably even be done with
> Parameters to the query and Global Variables. Take a look at www.sqldts.com
> for some great examples on all sorts of DTS stuff.
>
> -Pete
>
> "Jeff Turner" <jturner@discussions.microsoft.com> wrote:
>
> > Hello,
> >
> > I am new to SQL Server and apologize if this is the wrong group for this
> > question.
> >
> > I currently run several DTS packages to import data from an AS/400 via
> > Client Access ODBC. The packages are setup to delete all rows from my
> > existing tables then import the data from the AS/400 into them. Ideally I
> > would like to append only new records from the AS/400 rather than importing
> > then entire table(s) from the AS/400 (one of my table has 4.5 million
> > records) every time the package runs.
> >
> > Could anyone point me in the right direction?
> >
> > Thanks,
> >
> > Jeff
>
>



Relevant Pages

  • Linked server to as400 - for the love of god please help.
    ... i'm trying to setup a linked server between SQL Server and an AS400/DB2/IBM ... OLE DB provider 'MSDASQL' reported an error. ... OLE DB error trace [OLE/DB Provider 'IBMDA400' IColumnsInfo::MapColumnIDs ...
    (microsoft.public.sqlserver.server)
  • Re: Linked server from SQL Server to Access db on network share?
    ... What it looks like is this: SQL can create a linked server to a file on a remote share, but you can't query against it using Query Analyzer from any system other than the one hosting SQL... ... EXEC sp_tables_ex 'OLDSQL' ... OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. ...
    (microsoft.public.sqlserver.msde)
  • issue with openquery
    ... I have set up a linked server to DB2 AS/400 as the following: ... and then ran the open query: ... OLE DB error trace [Non-interface error: OLE DB provider unable to process ... But if I directly run the query through the DB2 client on my SQL Server, ...
    (microsoft.public.sqlserver.server)
  • Re: Cant edit Linked Server General Properties after saving
    ... OLE DB Provider for Oracle. ... Server dialog after creating the Linked Server the General Properties ...
    (comp.databases.ms-sqlserver)
  • OLE DB Provider for ODBC and Oracle
    ... I created a linked server for MS SQL Server 2005 Express to an Oracle ... database using the OLE DB Provider for ODBC. ... I'm using the OLE DB Provider for ODBC instead of the Oracle OLE DB ...
    (comp.databases.ms-sqlserver)