Extracting column descriptions from AS400 database for accompanying SSIS package

  • I'm building a SSIS package to extract data from an AS400 system and import into SQL. The actual transfer runs fine, but the tables, as configured in the AS400 have cryptic column names. Luckily, the AS400 programmer has put in usefull column descriptions. I do not want to manually rename all the column names once I build the tables in SQL. Ultimately, I would like to find a way to pull all the column descriptions from the AS400 and incorporate them into a script to build the corresponding tables in SQL.

    I know very little about AS400's, so I'm taking the approach of developing a .Net application that will connect to the AS400 via the IBM iSeries OLE DB drivers (or the Microsoft driver), and then pull the column descriptions out from the AS400's metadata. However, I'm having trouble getting started.

    I would appreciate any assistance in this endeavor if anyone has some insight. Thanks.


    Kindest Regards,

    DrewTheEngineer

  • Drew,

    Here is a query I use to get this data in a .NET app:

    [font="Courier New"]SELECT

         COLUMN_NAME AS Name,

         COLUMN_TEXT AS Description,

         DATA_TYPE AS TYPE,

         LENGTH AS Length,

         NUMERIC_SCALE AS Scale,

         NUMERIC_PRECISION AS PRECISION,

         IS_NULLABLE AS Nullable

    FROM

         QSYS2.SYSCOLUMNS

    WHERE

         TABLE_SCHEMA = ? AND

         TABLE_NAME = ?[/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply